Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

accumulative sum?

hi friends,

ı want to use accumulative sum, but not from the "accumulation" option in the properties tab,

because when you do like that , it is not static, it calculates again when you filter the terms.

ı want ıt to be static. so this has to be done by expression I think.

how can we do?

9 Replies
sunilkumarqv
Specialist II
Specialist II

jonathandienst
Partner - Champion III
Partner - Champion III

Do it like this:

  • Build an expression that sums your metrics up to the min value on the chart. Lets call that <expr1>
  • Then you need an expression that accumulates win the chart. Lets call your existing expression <expr2>. The accumulation will be of the form:
      • RangeSum(Above(<expr2>, 0, RowNo()))
  • So your final expression will be of the form:
      • RangeSum(Above(<expr2>, 0, RowNo())) + <expr1>
      • OR
      • RangeSum(RangeSum(Above(<expr2>, 0, RowNo())), <expr1>) // if expr1 could be null


For more specific help, I suggest that you post a sample qvw file that contains the base expression (<expr2> above).

HTH

Jonathan



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

jonathan thanks for your effort,

but ı have difficulties,

could you help about the expressions?

my table is likte that

stock value , customer ,      term

10                    a              201401

20                    a               201401

30                    b               201402

40                    c               201403

50                    c               201404

ı think ı have to use, stock value and term columns.

awhitfield
Partner - Champion
Partner - Champion

Hi fisland92,

see if the attached is what you want

HTH

Andy

Anonymous
Not applicable
Author

None of the above worked sorry,

when you filter it , it sums the filtered area not the total,

ı want the cumulative total to be static.

Not applicable
Author

Hi,

If you like it to be a static value would it perhaps be best to calculate when you run the script or using a set analysis expression to get a number that dont change upon selections.

Anonymous
Not applicable
Author

ıt can be done with load script but anyway you can not filter the data then.

so ıt should be done with accumulate expression but we could not fix it, it is always dynamic when you select certain terms the sum changes.

Not applicable
Author

You need to exclude the fields for which selections should impact your result from the expression.

For example in the expression provided by Andrew if you do not want selections in customer to impact expression result then use customer= in the set expression like this:

RangeSum(Above(Sum({<customer=>}[stock value]), 0, RowNo()))


Anonymous
Not applicable
Author

nice but it does not effect the month column.

also I can not change the sort order. the formula makes ascending months cumulative but ı need descending months.