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

Average Calculation with NumSum and RangeSum

Hello,

What is wrong with my expressions. I have a table Calculated Values. in this table I have a dimension Hist.LogDate and two expressions:

= numsum(above(Sum(Hist.WertRueckstand),0,(aggr(RowNo(),Hist.LogDate))))

= numavg(above(Sum(Hist.WertRueckstand),0,(aggr(RowNo(),Hist.LogDate))))

The first one accumulated the values of  Hist.WertRueckstand and there something goes wrong. When I take RangeSum instead of NumSum, the results are the same.

I have added a column Sum(Hist.WertRueckstand) with Full Accumulation, this are the right accumulated values.

My expression gives sometimes the right values: from date 01.09.2018 till 03.09.2018, 05.09.2018 till 07.09.2018 and 09.09.2018 till 10.092018. And for 04.09.2018, 08.09.2018 it calculates the wrong values.

Of course the second expression calculates also the wrong averages.

I have check the sum(value) for every day, the sum is the total of open orders (as it should be).

It makes no difference when I choose another Company, Productionpool.

I hope someone can correct my expressions with result the correct accumulation and correct average of the accumulation.

I have added a document with an example.

What I don‘t understand is  that when I take all days there are some wrong calculations for  instance 04.09.2018, from 05-09 till 07-09 is correct.

From 01.09 till 03.09 it seems correct but when  I take a range of date from 01.09 till 03.09 the accumulation is not correct

Thanks in advance

Regards Court

 

0 Replies