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: 
TomBond77
Specialist
Specialist

Error in expression

Hi experts

I have this formula in a dimension:

=[Timestamp.autoCalendar.YearMonth]={'>=$(=Monthstart(Addmonths(Max(Timestamp.autoCalendar.YearMonth),-11)))<=$(=MonthEnd(Max(Timestamp.autoCalendar.YearMonth)))'}

It gives an error in expression although the result is shown in the information bar: 

TomBond77_0-1692683404241.png

 

Where is the error?

Thanks.

Labels (5)
1 Reply
rubenmarin

H, that's not a full expression, it's just a set analysis. Set analysis it's just a filter for data, but it needs the rest of the expression to know what to do with that data, ie:

Sum({<[Timestamp.autoCalendar.YearMonth]={'>=$(=Monthstart(Addmonths(Max(Timestamp.autoCalendar.YearMonth),-11)))<=$(=MonthEnd(Max(Timestamp.autoCalendar.YearMonth)))'}>} Value)

BTW, to use operators like >= or <= the syntax is with double quotes, simple quotes is used to look for exact coincidence of strings.

[Timestamp.autoCalendar.YearMonth]={">=$(=Monthstart(Addmonths(Max(Timestamp.autoCalendar.YearMonth),-11)))<=$(=MonthEnd(Max(Timestamp.autoCalendar.YearMonth)))"}