Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
New-Qlik
Creator II
Creator II

How to calculate Cumulative and forecast

Hi,

I have a two columns in table

1. Date

2. quantity

taking these two I have to calculate cumulative and forecast

1. Cumulative :

Example 1

cumulative wrt to 2016022601 = sum(quantity for 2016022601 + 2016022600)

cumulative wrt to 2016022602 = sum(cumulative value wrt previous date (2016022601) + quantity wrt to 2016022602)

2. Forecast:

Example1:. Forecast - 12 Hours on Actual wrt to 2016022605 =   average(2016022600,2016022601,2016022604,2016022605)*0.75+ (Forecast - 12 Hours on Actual of previous date(2016022604) *0.25)

Example2 . Forecast - 12 Hours on Actual wrt to 2016022606= average(2016022600,2016022601,2016022604,2016022605, 2016022606)*0.75+ (Forecast - 12 Hours on Actual of 2016022605 *0.25)

     

Row LabelsSum of QtyForecast - 12 Hours on ActualCumulative Fcst Mvg Ave
20160226002
20160226013 5
20160226049 14
201602260521735
2016022606391374
201602260761380
201602260871387
20160226092413111

Kindly let me know if there are any questions

Thanks
Avneet


1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

please check your calculation : is this right ?

2. Forecast:

Example1:. Forecast - 12 Hours on Actual wrt to 2016022605 =  average(2016022600,2016022601,2016022604,2016022605)*0.75+ (Forecast - 12 Hours on Actual of previous date(2016022604) *0.25)

Average : (2+3+9+21)/4=8.75

Average * 0.75 = 6.56

9*0.25 = 2.25

6.56+2.25 =8.86      ?

but you are showing as  7  ?

And try this in expression and let me know :

if(rowno()<4,'',((Rangeavg(above(Sum({1} Quantity),0,4)))*0.75)+((above(SUM(Quantity)))*0.25))

  = 8.81




1. Cumulative :

try this :





if(rowno()=1,'',Rangesum(above(Sum( Quantity),0,rowno())))



View solution in original post

5 Replies
Anonymous
Not applicable

Hi

please check your calculation : is this right ?

2. Forecast:

Example1:. Forecast - 12 Hours on Actual wrt to 2016022605 =  average(2016022600,2016022601,2016022604,2016022605)*0.75+ (Forecast - 12 Hours on Actual of previous date(2016022604) *0.25)

Average : (2+3+9+21)/4=8.75

Average * 0.75 = 6.56

9*0.25 = 2.25

6.56+2.25 =8.86      ?

but you are showing as  7  ?

And try this in expression and let me know :

if(rowno()<4,'',((Rangeavg(above(Sum({1} Quantity),0,4)))*0.75)+((above(SUM(Quantity)))*0.25))

  = 8.81




1. Cumulative :

try this :





if(rowno()=1,'',Rangesum(above(Sum( Quantity),0,rowno())))



Anonymous
Not applicable

Hi

Have you checked my solution , if it is okay . please mark "correct anwer" or "helpful"

otherwise

some one else from community will surely help you......

New-Qlik
Creator II
Creator II
Author

Hi Allu,

It is correct and working fine.Thanks for helping

Regards

New-Qlik
Creator II
Creator II
Author

Can we build same expression in script level ?

Thanks

New-Qlik
Creator II
Creator II
Author

How can we build this expressions in script.