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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous period sum formula

Hello everyone,

i have such an issue - there is sales sum in several months and i need to get previous period sum (in that case previous month) while selected one certain month. I have tried about 5-6 formulas and no one works, for example:

Sum({$<Month={"$(=Max([Дата.autoCalendar.Month])-1)"}>}  [Sum] ) - this shows the same sum (selected and previous month), though there is another sum in previous month.

Снимок.PNG

Could anyone help me?

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this:

Sum({$<[Дата]={"$(='>=' & Date(Monthstart(Max([Дата]),-1), DD.MM.YYYY') & '<' & Date(Monthstart(Max([Дата])), DD.MM.YYYY'))"}, [Дата.autoCalendar.YearMonth]>}  [Sum] )

Capture.PNG

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

Try this:

Sum({$<[Дата]={"$(='>=' & Date(Monthstart(Max([Дата]),-1), DD.MM.YYYY') & '<' & Date(Monthstart(Max([Дата])), DD.MM.YYYY'))"}, [Дата.autoCalendar.YearMonth]>}  [Sum] )

Capture.PNG

Not applicable
Author

it works! thanks a lot.