Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with a simple Set Expression

Following advice from literature and forum contributions I have created a master calendar with fields

Period

Year

Month

Year-Month

Quarter

PeriodID

where 'Period' is simply YYYYMM linking it to an identical field in the main data table.

The field 'PeriodID' is autonumbering the records to create a unique identifier.

My app has a Multi Box for the selction of a customer and a month.

What I have observed is that my expression to calculate the sales for a customer in the previous month

Sum({$< PeriodID = {$(=Max(PeriodID)-1)}, Year = , Quarter = , Month = , Period = >}[Sales])

only returns a value >0 when I use the fields 'Period' or 'PeriodID' for selections in the Multi Box. When I use the field 'Year-Month'  the result of the expression is 0.

I have validated that Max(PeriodID)-1 returns a correct value.

Any idea where the problem is?

10 Replies
Anonymous
Not applicable
Author

I believe tis expression is correct, only the field name must be in brackets:

..."Year-Month"=,...