Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chetansehgal
Creator
Creator

unable to calculate previous Month sales in Qlik Sense

Hi,

I am trying to use below formula in Qlik Sense which works fine in QlikView but not in Qlik Sense.

Sum({<Month_Num={"$(=Max(Month_Num)-1)"}>}[Sales Amount (Actual)])

It gives zero only. in Qlik Sense.

Any help will be appreciated.

Thanks,

Chetan

5 Replies
sunny_talwar

Have you checked that the field names match exactly? Month_Num is not MonthNum or Month_num? Because I don't see any reason for this expression to not work in Qlik Sense. May be share a sample for us to see?

Gysbert_Wassenaar

Please post a small qlik sense app that shows this problem.


talk is cheap, supply exceeds demand
satishkurra
Specialist II
Specialist II

Quick work around is see first the below 2 expressions individually displaying values or not in a TextObkect/Image in QlikSense


=Max(Month_Num)-1


Sum([Sales Amount (Actual)])


Also get the list object for Sales AMount and MOnth_Num to see if values are present

ziadm
Specialist
Specialist

Hi

Make sure that Month_num is numeric value

Load

Num(Month(Date) as Month_num

or use dual function

Then change your syntax

Sum({<Month_Num={"=Max(Month_Num)-1"}>}  [Sales Amount (Actual)])

Hope this works 

Please tag as correct or helpful if this works for you

Regards

Ziad

chetansehgal
Creator
Creator
Author

Thanks everyone for the help ...

I tried using below formula and it works fine now..but dont know why the previous formula was nor working.

=sum({$<Year={"$(=Max(Year))"},MonthID={"$(=Max(MonthID)-1)"},Month=>}[Sales Amount (Actual)])

Thanks,

Chetan