Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table and I want to filter the records based on a choice of a variable that is being set via a button in the master item list. I think I have done this before but just can't find the reference I used or a answered question in the forums that does this for Qlik Sense in specific. Please help.
The purpose is to show differences in 'Regular' employees vs 'Campus/Interns'. The field on each row is EXCLUDE_FROM_COUNTS, with 1 for Yes (exclude, aka interns) and 0 for No (include, aka regular).
The Variable is 'vEE_TYPES' where the values are either 'REGULAR' or 'CAMPUS-INTERN'.
I have a sample working measure/count filter, but I need a dimension/row filter.
My working code that will show counts based on the variable:
=IF('$(vEE_Types)'='REGULAR',Count({<EXCLUDE_FROM_COUNTS = {0}>} ID),
IF('$(vEE_Types)'='CAMPUS-INTERN',Count({<EXCLUDE_FROM_COUNTS = {1}>} ID),0
)
)
My ham-fisted attempt to do this as a calculated dimension that gets 'error in expression' but no clue why:
=IF('$(vEE_Types)'='REGULAR',IF(Aggr(Count({<EXCLUDE_FROM_COUNTS = {0}>}),ID)>=1,ID),
IF('$(vEE_Types)'='CAMPUS-INTERN',IF(Aggr(Count({<EXCLUDE_FROM_COUNTS = {1}>}),ID)>=1,ID),Null
)
)
You're not counting anything. You have basically written aggr(count(), ID)
=IF('$(vEE_Types)'='REGULAR',IF(Aggr(Count({<EXCLUDE_FROM_COUNTS = {0}>} add_something_to_count_here),ID)>=1,ID),
IF('$(vEE_Types)'='CAMPUS-INTERN',IF(Aggr(Count({<EXCLUDE_FROM_COUNTS = {1}>} add_something_to_count_here),ID)>=1,ID),Null
)
)
In your first expression, the working one, you're counting ID but here you are doing an aggregation of "nothing" over ID.
You're not counting anything. You have basically written aggr(count(), ID)
=IF('$(vEE_Types)'='REGULAR',IF(Aggr(Count({<EXCLUDE_FROM_COUNTS = {0}>} add_something_to_count_here),ID)>=1,ID),
IF('$(vEE_Types)'='CAMPUS-INTERN',IF(Aggr(Count({<EXCLUDE_FROM_COUNTS = {1}>} add_something_to_count_here),ID)>=1,ID),Null
)
)
In your first expression, the working one, you're counting ID but here you are doing an aggregation of "nothing" over ID.
Thanks! that did it, I was just missing something super obvious, lol