Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rasmusnielsen
Partner - Creator
Partner - Creator

Filter is not ignored by {1<>} set expressions

I have the following measure in a KPI in my Qlik Sense app:

Count({1}distinct Aggr({1<date={"$(vCompareDate2)"}>} If(Avg({1<date={"$(vCompareDate1)"}>} discount) > Avg({1<date={"$(vCompareDate2)"}>} discount), station), station, product))

My model looks like

Data
date
station
product
segment
brand
discount

I have a filter on the segment.

When I make changes to the segment filter, it also updates my KPI, which (to my best knowledge) SHOULD IGNORE segment values.

Segment is not part of the AGGR and I have spread a bunch of {1} set expressions, which should ignore segment filter as well.

What am I doing wrong here?

Thanks!

2 Replies
rasmusnielsen
Partner - Creator
Partner - Creator
Author

I have attached a test app. that demonstrates my problem.

My expectation is that when making changes to the segment filter, it does NOT change the value in the KPI.

(The KPI shows the number of unique stations that are have a lower discount on date 2 compare to date 1)

rasmusnielsen
Partner - Creator
Partner - Creator
Author

Ahh, after reading:

Use Aggregation Functions!

I finally made it work using:

Count({1} distinct Aggr(If(Avg({1<date={"$(vCompareDate1)"}>} discount) > Avg({1<date={"$(vCompareDate2)"}>} discount), Only({1}station)), station, product))