Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
thi_pham
Creator III
Creator III

Concern on scope of set analytics

I have a concern on this case, I have a date field which value from 2020-01-01 -> today()

I have a measure like: sum({<Date={"<=$(vMaxDate)"} Sale)  with vMaxDate = date(max(Date),'YYYY-MM-DD')

When I filter date = 1 value such as 2020-09-01

Then measure return value of sum sale from 2020-01-01 to 2020-09-01. Or just sum sale in 1 date 2020-09-01. ????

From my understanding , without specify 1 in the set analytics, the scope of it will be on filtered values -> it should be return sum sale of 1 date only, but when I tried, it actually return sum sale of whole period, how it possible?

 

 

 

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

@thi_pham 

With sum({1<Date={"<=selectedDate"} Sale), you are telling to ignore ALL fields' selection (date field as defined in expression), whereas, without {1}, you are telling to disregard only the Date field selection (and consider dates as defined in the expression). 

View solution in original post

4 Replies
tresesco
MVP
MVP

@thi_pham , when you are selecting a date, your expression is essentially, becoming like:

sum({<Date={"<=selectedDate"} Sale) . Therefore, it would give sale for all dates '<=' selectedDate.

thi_pham
Creator III
Creator III
Author

Yes, it will be your mentioned expression. However, my concern is when I filter the date field by selecting 1 date only, the scope of data for this expression is just on 1 date only, not whole dataset.

If it behave like this, then what's different between

sum({<Date={"<=selectedDate"} Sale)  VS sum({1<Date={"<=selectedDate"} Sale)

 

tresesco
MVP
MVP

@thi_pham 

With sum({1<Date={"<=selectedDate"} Sale), you are telling to ignore ALL fields' selection (date field as defined in expression), whereas, without {1}, you are telling to disregard only the Date field selection (and consider dates as defined in the expression). 

thi_pham
Creator III
Creator III
Author

woa, thanks for your explanation. I just thought that prefix $, 1 will affect to all fields (include the field specified in the set analytics), then with $, it will be and condition between value in set analytics and current filtered value of app.