I collect and develop a wide range of analytics for this community, support the operation of analytics platforms, and check the quality of open exchange applications.
Thanks for the reply!
As i said, the query works perfectly fine when executed normaly (without $$$ tokens). The data is correct
I should add some details then
When I compare dates in the WHERE clause, I convert them to INTs, just to make sure all the data is consistent. I also do a slightly more complex comparison. I've omitted the details because they're not relevant to my case
anotherDateField BETWEEN CAST(TO_CHAR(dateFieldOne, 'YYYYMM') as int) and CAST(TO_CHAR(dateFieldTwo, 'YYYYMM') as int)
Next, the date format is %TimeStamp, and it's very common in my data. I work with it every day, and every time function you can think of works without a problem
So the time data works fine, the outer WHERE clause doesn't catch up because of $$$RESTRICT in the inner section but without it the listing would not work at all
If it is pure ObjectScript how to write IF ELSE statement in %expression for example? Or can i use RETURN stetement?
There are situations when you need to return a specific value. The Range expression doesn't work, for example, when you need to determine the display value for Null.
So there's only one way
IF 'value {return "Value is False"} else {return "Value is True"}
But this is wont work
I can still define a class method inside the cube and reference it from within, for example, %cube.CustomLogicClass(%source.DBValue), but that seems redundant. It leaves my cube looking cluttered with simple functions containing only if-else logic.
I solved this problem by creating a SQL view and then join it inside a listing query
SELECT v.somefields FROM $$$SOURCE, CustomSchema.MyView as v WHERE $$$RESTRICT and source.Field = v.SameField