Hi Siegmund,
You can use ROUND_<%=timespan_picker%>(PU_FIRST(...)) in your formula without the case when if your variable has YEAR, MONTH or DAY.
Hi Cátia,
thanks for your answer.
That is already working but i have a chart where the user can pick between different timespans (HOUR, DAY, MONTH) and depending on what he picked the chart shows the number of cases which are moving go a certain area(for each hour or each day...)
So I need to assign different Formats to the Formula output. When the user picks DAY or MONTH the chart works but when he picks HOUR the format is still '%Y-%m-%d'.
So when the variable value is 'HOUR' I would like to format the output to FORMAT('%H:%M') and then the chart is on a hourly basis and when the variable value is != 'HOUR' I would like to format the output to FORMAT('%Y-%m-%d') and see days or months.
I mean something like this:
CASE WHEN <%=timespan_picker%> = 'HOUR' THEN
ROUND_HOUR(PU_FIRST (DOMAIN_TABLE("_CEL_OUTBOUND_ACTIVITIES"."_CASE_KEY"), "_CEL_OUTBOUND_ACTIVITIES"."_EVENTTIME", "_CEL_OUTBOUND_ACTIVITIES"."_ACTIVITY_EN"='Move to Sorter Split Area' )) ( and then FORMAT('%H:%M'))
ELSE
ROUND_<%=timespan_picker%>(PU_FIRST (DOMAIN_TABLE("_CEL_OUTBOUND_ACTIVITIES"."_CASE_KEY"), "_CEL_OUTBOUND_ACTIVITIES"."_EVENTTIME", "_CEL_OUTBOUND_ACTIVITIES"."_ACTIVITY_EN"='Move to Sorter Split Area' )) (and then FORMAT('%Y-%m-%d'))
END
Best
Niklas
You can try something like this
TO_STRING(ROUND_<%= timespan_picker %>("TABLE"."COLUMN"), FORMAT(<%= format %>))
You need to add a variable for the format.
It worked, thanks a lot. 🙌