I have a single graph with value parameter named _processor_KPI_agg
, which is an aggregate function of a calculated field named _processor_KPI
that chooses which field to take based on a chosen parameter named KPI
.
Below I will just describe how _processor_KPI_agg
is defined:
ifelse(
${KPI} = "A", avg({_processor_KPI}, [startDateTime]),
avg({_processor_KPI}, [endDateTime])
)
Based on the input parameter KPI
, it will return an aggregate function grouped by a field (in the case below by startDateTime
or endDateTime
). The calculated field does not throw any error, but when I place it as value in a graphic I get the following one: the level aware calculation (LAC) aggregate functions inside one visual aggregate functions should always share the same grouping key
I tested this other calculated field and works well:
ifelse(
${KPI} = "A", avg({_processor_KPI}, [startDateTime]),
avg({_processor_KPI}, [startDateTime])
)
This last calculated field which does not group the aggregate function in the else
case also throws a LAC error:
ifelse(
${KPI} = "A", avg({_processor_KPI}, [startDateTime]),
avg({_processor_KPI})
)
Thanks for your time, any help will be very appreciated!