Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

cumulative total sales by month with nested conditions

Good day, 

I want to build in Qlik Sense a chart that shows cumulative sales. But there are some features because of which I do not understand how to do it:
1. The period does not contain dates, but names of months: M1, M2, M3, ....
2. Also in the data array contains unnecessary information that you want to exclude / filter.

As is:

PeriodProductItemAmount
M1Product_1Item_110
M1Product_1Item_210
M1Product_1Item_310
M1Product_2Item_110
M1Product_2Item_210
M1Product_2Item_310
M2Product_1Item_110
M2Product_1Item_210
M2Product_1Item_310
M2Product_2Item_110
M2Product_2Item_210
M2Product_2Item_310
M3Product_1Item_110
M3Product_1Item_210
M3Product_1Item_310
M3Product_2Item_110
M3Product_2Item_210
M3Product_2Item_310
M4Product_1Item_110
M4Product_1Item_210
M4Product_1Item_310
M4Product_2Item_110
M4Product_2Item_210
M4Product_2Item_310

 

How need:

PeriodProductItemAmount
M1Product_1Item_310
M1Product_2Item_310
M2Product_1Item_320
M2Product_2Item_320
M3Product_1Item_330
M3Product_2Item_330
M4Product_1Item_340
M4Product_2Item_340

 

P.s. RangeSum(Above(SUM(Amount),0,RowNo())) does't work correctly, pls, help.

14 Replies
sunny_talwar

Convert M1, M2 to Jan and Feb... 😀... You don’t know how your data looks like?
Anonymous
Not applicable
Author

I know 🙂
Data is unloaded from the external system with codes: M1, M2, M3 ... and in MS Excel it is necessary to transform/translate it in Jan, Feb, Mar ... It would be great if this step could be skipped

sunny_talwar

I guess just use the if statement
If(Period = 'M1', 'Jan',
If(Period = 'M2', 'Feb', ....))

and then you can do this
Month(Date#(Period, 'MMM')) as Period

Or try this
Month(Date#(PurgeChar(Period, 'M'), 'M')) as Period

I guess you have a lot of options here... just have to decide what you wish to do.
Anonymous
Not applicable
Author

thanks a lot for Help
sunny_talwar

No problem at all 🙂
I am glad I was able to help.

Best,
Sunny