Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm trying to use this set analysis formula:
count({<ima_area=,application_name = {"=(anio_mes_created <= $(=Max(anio_mes)) or IsNull(anio_mes_created)) and (IsNull(anio_mes_deleted) or anio_mes_deleted >$(=Max(anio_mes)))"}>} DISTINCT application_name)
But the measure is affected when selecting any value of the dimension ima_area. Do you know why? Thank you.
Each part of the expression needs the information which selection-state should be adjusted against the default-state. Means the statement must be at least also set here:
count({<ima_area=,application_name = {"=(anio_mes_created <= $(=Max({<ima_area=>} anio_mes)) or IsNull(anio_mes_created)) and (IsNull(anio_mes_deleted) or anio_mes_deleted >$(=Max({<ima_area=>} anio_mes)))"}>} DISTINCT application_name)
Beside this is the statement for: application_name = {...} no real set analysis else an if-loop and I'm not sure if the field-references without applying an aggregation-function will behave in this case.
It doesn't work either... I've proved this:
Count(
DISTINCT
Aggr(
If(
(anio_mes_created <= Max({<ima_area=>} anio_mes) or IsNull(anio_mes_created))
and
(IsNull(anio_mes_deleted) or anio_mes_deleted > Max({<ima_area=>} anio_mes)),
application_name
),
application_name
)
)
but nothing.
Your calculation isn't a single expression else it is a combination of n nested aggregations which are evaluated separately against the selection state. Therefore each part must get an own set statement if not the default-state should be considered. This may look like:
count({ SET } aggr({ SET } sum({ SET ] Field), Dim))
and if a { SET } contains own aggregations these ones are also needing an appropriate set-statement, like:
... {< Field = {"<=$(=max({ SET } Field))"} >} ...
If your previous calculation worked unless the responsibility to certain selections the aggr-wrapping isn't needed else it would add more complexity as necessary. Personally I would evaluate the NULL topic within the script by creating appropriate flag-fields and then going probably with an approach like:
count(
{< FieldX, Flag1 = {1}, Flag2 = {1},
Date1 = {">=$(=max({< FieldX >} Date2))<=$(=max({< FieldX >} Date3))">} FieldY)
which is your final expression??
did you try with outer set analysis
{<ima_area=>}count({<application_name = {"=(anio_mes_created <= $(=Max(anio_mes)) or IsNull(anio_mes_created)) and (IsNull(anio_mes_deleted) or anio_mes_deleted >$(=Max(anio_mes)))"}>} DISTINCT application_name)
Regards,
Prashant Sangle
I tried it too, but nothing. I can't find a expression that works.
I can't create a flag with this dimension because the state changes depending on the selected year_month.
That the state could change over the time doesn't mandatory mean that the exists of one it couldn't be flagged. I wouldn't discard the adjustment/evaluation of it too easily because in the UI it's often simpler to query a replacement like '<NULL>' and/or a 0/1 flag - maybe per min(FlagField) - as trying to fetch a NULL.
Beside this don't try to solve your task with a complete calculation else dividing it into n parallel calculations side by side with a table-chart to detect the not working ones. If they were found and a bit trial and error doesn't help the data should be investigated within a table-box to see the real existing ones and their relationship to each other respectively the needed chart-dimensions and selections.
Like hinted above each field-call may need an explicit aggregation because each one is an implicit only() which itself would return NULL if more as a single value is available and only if an aggregation-function is applied a set statement could be used to adjust the selection state. This means you may need for each all of: anio_mes_created + anio_mes_deleted something like:
avg({< ima_area >} anio_mes_created)
May be this!
Count({<
ima_area =,
application_name = {"=anio_mes_created <= Max({<ima_area=>} anio_mes) or len(anio_mes_created)=0"},
application_name = {"anio_mes_deleted > Max({<ima_area=>} anio_mes) or len(anio_mes_deleted)=0"}
>} DISTINCT application_name)