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: 
ugurarslan
Creator
Creator

cumulative table with sum cash applied versus total invoiced$ per month

Dear all,

I have table with the following dimension and measurement:

Dimension:

day([Month date])

Measurement:

(Sum({<[Year Month]={'$(Current_Month_YYYYMM)'}>}[Cash App Amt USD])

/

Sum({<[Year Month]={'$(Current_Month_YYYYMM)'},[Trans Type]={'invoice'}>}total <[Year Month]>[Trans Amt USD]))

Table now shows:

DaysMeasurement
16
23
35
46
58
68
74
83
96
107
118
128
138
148
159
169
176
184
193
202

Now I want to see this result as cumulative.

DayCumulative
16
29
314
420
528
636
740
843
949
1056
1164
1272
1380
1488
1597
16106
17112
18116
19119
20121

How do I need to do this?

Please help me.

Ugur

9 Replies
OmarBenSalem

from:

sum(YourMeasure)

do :

aggr(

RangeSum(above(

Sum({<Days>}Measurement)

,0,RowNo()))

,(Days,ascend))


Result:

Capture.PNG

Even iuf u select a day, u'll have the cumulative sum well calculated:

Capture.PNG

and with the aggr() part, even if ur table is not sorted by ascending days, it'll still be calculated well:

Capture.PNG

ugurarslan
Creator
Creator
Author

aggr(

RangeSum(above(

Sum({<Days>}

[Year Month]={'$(Current_Month_YYYYMM)'}>}[Cash App Amt USD])

/

Sum({<[Year Month]={'$(Current_Month_YYYYMM)'},[Trans Type]={'invoice'}>}total <[Year Month]>[Trans Amt USD])

)

,0,RowNo()))

,(Days,ascend))

This didn't work...

ugurarslan
Creator
Creator
Author

aggr(

RangeSum(

above(

Sum({<[Month date]>}

[Year Month]={'$(Current_Month_YYYYMM)'}>}[Cash App Amt USD])

/

Sum({<[Year Month]={'$(Current_Month_YYYYMM)'},[Trans Type]={'invoice'}>}total <[Year Month]>[Trans Amt USD])

)

,0

,RowNo()))

,([Month date],ascend))

ugurarslan
Creator
Creator
Author

didn't work also

OmarBenSalem

aggr(

RangeSum(above(

(Sum({<Days, [Year Month]={'$(Current_Month_YYYYMM)'}>}[Cash App Amt USD])

/

Sum({<Days,[Year Month]={'$(Current_Month_YYYYMM)'},[Trans Type]={'invoice'}>}total <[Year Month]>[Trans Amt USD]))

,0,RowNo()))

,(Days,ascend)

ugurarslan
Creator
Creator
Author

Hi Omar, I couldn't define days. the days field is extracted from a formula to extract out of a day with using day([Month Date]). Can you please sent me the printscreens of the formula you put in your qliksense file.

Thanks

Ugur

ugurarslan
Creator
Creator
Author

I appreciate your help very very much, thanks for learning me.

ugurarslan
Creator
Creator
Author

Omar are you able to help me please?

OmarBenSalem

Can't u create the days dimension in the script then us it?