Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sales Comparison for current vs prior month

Can anyone please assist me ,i am new in qlikview , set analysis is challenging me , i have data for 2015 from january to july .

i want to compare sales for current month to Prior month e.g July vs June .i tried to use this expressions but its not working sum ::  current Month =({<Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'}>}TranAmt) and Prior month=sum({<Year={'$(vMaxYear)'},Month={'$(vPriorMonth)'}>}TranAmt).

Variables:

vMaxYear =max(if(vCalenderType='Fiscal',[Fiscal Year],Year))

vMaxMonth=max(if(vCalenderType='Fiscal',[Fiscal Month],Month))

vPriorMonth= vMaxMonth

Assist , if anyone has an example please post it , i am working on my first project.

2 Replies
maxgro
MVP
MVP

do you have a date field? if yes this is (often) a set analysis expression for previous month (d is my date field)

=Sum({$<d={">=$(=(addmonths(MonthStart(today()),-1)))<=$(=(MonthEnd(addmonths(MonthStart(today()),-1))))"}>} TranAmt)

1.png

subathra
Partner - Contributor III
Partner - Contributor III

Hi try like this,

sum({$<Month={$(=max(Month))}>}Tranamt)-sum({$<Month={$(=max(Month)-1)}>}Tranamt)