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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
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

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

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.