Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Showing cumulative in a chart

Hi

I have a log of disputed invoices and I want to show the cumulative of unresolved items.  If an item has been resolved I want it to be included in all the weeks up until it was resolved.  My data is similar to this:

      

NumberDate EnteredWeek EnteredAmountDate ResolvedWeek Resolved
110/05/201719 609.06 25/06/201726
213/05/201719 992.96 27/05/201721
314/05/201720 812.94 20/05/201720
419/05/201720 577.54
523/05/201721 78.82 22/06/2017
625/05/201721 306.54
725/05/201721 982.49
826/05/201721 170.47
926/05/201721 707.13 30/05/201722
1030/05/201722 658.47 05/06/201723
1131/05/201722 689.73
1231/05/201722 883.85
1301/06/201722 856.51 29/06/201726
1403/06/201722 296.76
1503/06/201722 676.41 27/06/201726
1604/06/201723 442.61
1707/06/201723 253.07
1808/06/201723 184.38
1911/06/201724 430.78 11/06/201724
2012/06/201724 921.79 25/06/201726
2112/06/201724 79.73 18/06/201725
2213/06/201724 276.19 26/06/201726
2314/06/201724 136.31 23/06/201725
2415/06/201724 437.31
2521/06/201725 989.07 24/06/201725
2624/06/201725 400.28
2724/06/201725 63.20
2826/06/201726 351.27 28/06/201726
2930/06/201726 386.38 04/07/201727
3004/07/201727 218.02

And I want to achieve this:

  

WeekCumulative Unresolved
19 1,602.02
20 2,179.56
21 3,432.05
22 6,786.65
23 7,008.24
24 8,859.57
25 9,107.01
26 6,153.43
27 5,985.07

For example week 24 is all the values up to and including week 24 less any resolved values resolved in week 24 and before (item 20 would be included in the cumulative for week 24 and 25 but not in 26)

Please help

Thanks

A

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can create records for all dates / weeks between enter date and resolved date (for unresolved, you can use Today() as upper limit), just like shown in

Creating Reference Dates for Intervals

View solution in original post

4 Replies
swuehl
MVP
MVP

You can create records for all dates / weeks between enter date and resolved date (for unresolved, you can use Today() as upper limit), just like shown in

Creating Reference Dates for Intervals

Anil_Babu_Samineni

How you are getting 3,432.05 for 21


I am getting like below, I don't think how you are getting. Will you explain little more?

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
effinty2112
Master
Master

Hi Adrian,

This is best achieved with a little bit of scripting:

Add this data island to your model, I've called the table your data comes from Data.

Accumulate:

LOAD

[Week Entered] as Week,

Sum(Amount) as Entered

Resident Data

Group by [Week Entered];

Left Join (Accumulate)

LOAD

[Week Resolved] as Week,

Sum(Amount) as Resolved

Resident Data

Group by [Week Resolved];

Now we can get this straight table:

Week Cumulative Unresolved
19£1602.02
20£2179.56
21£3432.05
22£6786.65
23£7008.24
24£8859.57
25£9107.01
26£6153.43
27£5985.07

Cumulative Unresolved = Sum(Entered)-Sum(Resolved)

or if you prefer

Cumulative Unresolved = RangeSum(Entered,-Resolved)

It goes without saying but I'll say it anyway: set accumulation on the expression to Full Accumulation.

Cheers

Andrew

Anonymous
Not applicable
Author

Once I changed it a bit to fit my data, it worked perfectly.  Such a simple solution

Many thanks