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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Using MonthNum - 1 in set analysis

Dear Qlikview user

I am trying to create a expression which always counts data from the previous month when a user selects from my month list box:

I.e. If a user selects Aug then the expression should show data for Jul

Month List Box:

Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar

My expression so far is:

count({$<Description = {'01) ABC'},

FactDate = {'>=$(=Monthstart(Addmonths(date(max(FactDate)), -1))) <=$(=MonthEnd(Addmonths(date(max(FactDate)), -1)))'} ,

[Breach Indicator] = {'N'}>}ID_NO)

yet although Monthstart(Addmonths(date(max(FactDate)), -1 and MonthEnd(Addmonths(date(max(FactDate)), -1 do pick up the correct dates, my data is not showing accuratley


Does anyone know a good way to show a count for the previous month when a month name is selected


In addition I have a field called MonthNum which I could use along lines of MonthNum-1


Any help would be greatly appreciated


Thanks

Helen

1 Reply
sunny_talwar

May try to ignore Month in your expression:

Count({$<Description = {'01) ABC'}, FactDate = {'>=$(=Monthstart(Addmonths(date(max(FactDate)), -1))) <=$(=MonthEnd(Addmonths(date(max(FactDate)), -1)))'}, Month, [Breach Indicator] = {'N'}>}ID_NO)