Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Partner
Partner

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
Highlighted
Partner
Partner

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

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)

Highlighted
Partner
Partner

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

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))