Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
mariamartinez_123
Contributor II
Contributor II

disable filter doesn't work

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.

Labels (5)
8 Replies
marcus_sommer

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.

mariamartinez_123
Contributor II
Contributor II
Author

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.

marcus_sommer

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)

PrashantSangle

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

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
mariamartinez_123
Contributor II
Contributor II
Author

I tried it too, but nothing. I can't find a expression that works.

mariamartinez_123
Contributor II
Contributor II
Author

I can't create a flag with this dimension because the state changes depending on the selected year_month.

marcus_sommer

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)

Nagaraju_KCS
Specialist III
Specialist III

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)