Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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)
Ahh, after reading:
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))