Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Krish
Contributor III
Contributor III

Prior Month sales in text box

Hi,

I am trying to get sum of sales (prior year same month) in Qlikview, but it doesn't work.

Eg: If I select month as Feb  (year is a separate selection which is 2020) then I should get the sum of sales of 2019 Feb.

Below is the one I tried.

=SUM({< Month= {"$(=Date(AddMonths(Max(Month), -1), 'MMM'))"}>}sales)

Labels (2)
1 Solution

Accepted Solutions
prma7799
Master III
Master III

Try this

Sum({<Year=,Month=,Date={">=$(=AddYears(MonthStart(max(Date)),-1)) <=$(=AddYears(max(Date),-1))"} >} sales)

View solution in original post

2 Replies
prma7799
Master III
Master III

Try this

Sum({<Year=,Month=,Date={">=$(=AddYears(MonthStart(max(Date)),-1)) <=$(=AddYears(max(Date),-1))"} >} sales)

Krish
Contributor III
Contributor III
Author

Can you try the below code

Num(sum({$<Quarter=,Year=,Month=,MonthYr=,Date = {">=$(=monthstart(addmonths(max([Date]),-1)))<=$(=MonthEnd(addmonths(max([Date]),-1)))"}>} sales),'#,###.###'))