Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to cummulate with selection?

Hi,

i have a question regarding cummulation of values with different dimensions. Database is a list with changes. I want to calculate the cumulative value for the different dimensions. Please see the dataset

DAYMANDTPORTIONCHANGECUMM
01.01.2009100ABCDE10.00010.000
01.01.2009100VWXYZ5.5005.500
02.01.2009100ABCDE10010.100
02.01.2009100VWXYZ55.505
03.01.2009100ABCDE-1010.090
03.01.2009100VWXYZ-35.502
04.01.2009100ABCDE3010.120
04.01.2009100VWXYZ65.508
05.01.2009100ABCDE-4010.080
05.01.2009100VWXYZ65.514
06.01.2009100ABCDE2010.100
06.01.2009100VWXYZ85.522
07.01.2009100ABCDE3010.130
07.01.2009100VWXYZ55.527
08.01.2009100ABCDE-4010.090
08.01.2009100VWXYZ35.530

My question is, how can i calculate the correct cumulative value within the comlete dataset, even if i selected a specific date (07.01, 08.01), in other words calculate the correct cumulative value (without selection) for specific dimensions from start of dataset till selected date (s.th like sum ({$<date >= (date (01.01.2009, DD.MM.YYYY)>} Changes) ?? ). The result should look like this with selection of 07.01.2009 and 08.01.2009:

DAYMANDTPORTIONCHANGECUMM
07.01.2009100ABCDE3010.130
07.01.2009100VWXYZ55.527
08.01.2009100ABCDE-4010.090
08.01.2009100VWXYZ35.530

Thank you very much for your help!!

Greetz

7 Replies
Not applicable
Author

has no one a hint in which direction I can search?  - Please

Thank you very much!

Miguel_Angel_Baeyens

Hi,

Use a variable in a slider/calendar object instead of selecting in the field. Then use this variables in the set analysis as in this application.

Hope that helps.

Miguel

Not applicable
Author

Hi Miguel,

thank you very much for your answer. Your file is very helpful.

I used the Date Variables (vStartDate and vEndDate) to select the changes. For the Sum (cumulative) i used the whole time period. The problem is that the Dimension (Days) is shown for the whole period.. For the selected time period (vStart.. till vEnd..) the changes have the value 0.

In addition the cumulative sum is not correct. Do you have an idea what the problem might be.

Thank you so much!

Jezze

Miguel_Angel_Baeyens

Hi Jezze,

Not sure if I got you right. Check the ammended file though.

Hope that helps.

Miguel

Not applicable
Author

Hi Miguel,

thank you for your answer. Maybe the cumulative sum is not working for more than one dimension..

Your formula "RangeSum(Above(Sum(SalesAmount), 0, RowNo()))" is a good idea and shows the same result like using the radio button "Accumulation" in the formula register.

I´m sorry that i did not explained clearly how the final table should look like. It would be great if following requirements could be met or ideas how i can handle them.

  • It should be possible to limit the time table (no problem -> normal functionality)


  • The line "changes" should respond to the time restriction and only represent the values ​​in the Time range (e.g. 07.01.2009 - 08.01.2009).

  • The row "Cumm" should not react to the time restriction and display the sum of all values ​​from the first day (MinDate) until now or until the value shown in each casewithin the time range. (e.g. Sum from 01.01.2009 until 07.01.2009  and next line sum 01.01.2009 till 08.01.2009)


  • If possible, the cumulative amount should not only be one dimension (date) will becalculated correctly but after several dimensions.

I´ m really excited for your ideas.

Thank you very much for your help.

Greetings

Jezze

Miguel_Angel_Baeyens

Hi Jezze,

Indeed I was wrong. Is that what you are looking for?

Miguel

Not applicable
Author

Hi Miguel,

that looks great, thank you,..

There is only one functionality missing - but i see, i didn´t explain it very well - i´m very sorry for that.

The "Cumm" columns should be calculated as a sum of all values of the "Change" columns from the first day of dataset till the selected date range.

The "Cumm" column should not be a part of the original dataset. The dataset should only consist of Day, Mand, Portion and Change. (I just wanted to show it to explain how the values are calculated).

Best greetings

Jezze