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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous month not working - Set analysis

hi i am attempting to show the previous month here, however it is not working according to plan.

the syntax seems correct however, so not sure if there is an underlying problem in the data.

any help would be greatly appreciated.

Best

Brad

=Count({$< inLeveransDatumMonth = {$(=Max(inLeveransDatumMonth)-1)}  >}

    (Inlev_Radnummer))

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your month field isn't a number, but a dual value. That complicates things. One way is to use this expression:

count({<inLeveransDatumMonth={'>=$(=max(inLeveransDatumMonth)-1)<=$(=max(inLeveransDatumMonth)-1)'}>}Inlev_Radnummer)

You could also create a numeric month field in the script and use that instead: autonumber(monthstart(MyDate),'MonthSerial') as MonthSerial


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your month field isn't a number, but a dual value. That complicates things. One way is to use this expression:

count({<inLeveransDatumMonth={'>=$(=max(inLeveransDatumMonth)-1)<=$(=max(inLeveransDatumMonth)-1)'}>}Inlev_Radnummer)

You could also create a numeric month field in the script and use that instead: autonumber(monthstart(MyDate),'MonthSerial') as MonthSerial


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Unless there is a valid reason to use set analysis, this can work:

=Count(if(inLeveransDatumMonth = Max(all inLeveransDatumMonth)-1, Inlev_Radnummer))

Not applicable
Author

this actually works, really cool i can perhaps use it in other places, thanks Michael your a star!