Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tracycrown
Creator III
Creator III

Exponential Forecast

Dear all

Can someone help to show me an example on how to write a script in expression for exponential foreast by months?.

 

YearMonthSales VolumeExponential Forecast (0.1)Exponential Forecast (0.7)
Oct-201490
Nov-2014106
Dec-2014152
Jan-2015244
Feb-2015302
Mar-2015274
Apr-2015162
May-2015194
Jun-2015312
Jul-2015359
Aug-2015215
Sep-2015126
Oct-201594
Nov-2015125
Dec-2015147

Thank you very much

Tracy

21 Replies
tracycrown
Creator III
Creator III
Author

Dear Sunny

Sorry, I do not know how to get the results, it was downloaded from SAP.

Tracy

settu_periasamy
Master III
Master III

Hi,

I don't understand, why the previous 2 rows coming under current. Anyhow, as i mentioned earlier, you can just use the previous() in script to get the 2 rows. And in in the expression use Peek().

Check the Attachment..

Capture.JPG

tracycrown
Creator III
Creator III
Author

Dear Settu

Please advise how to show just the highest total (2831) of  Exp_Forecat in the chart (ie. 0.7) ?.

By the way, I failed to use the following in scrip, please help.

rangeavg(above(sum([Sales Volume])),-1,2))

Thank you

Tracy

settu_periasamy
Master III
Master III

Hi,

where do you want to show the total (2831) in the chart? generally you can use the expression.

=sum([Exp_Forecast(0.7)])

By the way, I failed to use the following in scrip, please help.

rangeavg(above(sum([Sales Volume])),-1,2))

there is one extra parenthesis..(not sure about the requirement)

rangeavg(above(sum([Sales Volume])),-1,2)


Can you post your qvw, and expected result?

tracycrown
Creator III
Creator III
Author

Dear Settu

Instead of showing both Exp 0.1 & Exp 0.7 on the report, just display the one with MaxTotal.

YearMonth     Sales Volume      MaxTotal

Thank You

Tracy

settu_periasamy
Master III
Master III

Like This? If so, you can just use sum(TOTAL [Exp_Forecast(0.7)])

Capture.JPG

see attached..

tracycrown
Creator III
Creator III
Author

Dear Settu

I would like to get the max between 0.1 & 0.7 or more variables in script instead of specifying 0.7 in sum Total,

Thank you

Tracy

settu_periasamy
Master III
Master III

Hi Tracy,

May be create one variable and assign the expression like below..

Variable Name :  vMax_Forecast

Value               :   =if(sum(TOTAL [Exp_Forecast(0.1)]) > sum(TOTAL [Exp_Forecast(0.7)]),sum(TOTAL                                 [Exp_Forecast(0.1)]),sum(TOTAL [Exp_Forecast(0.7)]))

tracycrown
Creator III
Creator III
Author

Dear Settu

I had inserted Max_Exp in the script but nothing shown on table, please help.

if(RecNo()=1,[Sales Volume], 
Num((1-$(vExp2))*Peek([Exp_Forecast(0.7)],RecNo()-2)+$(vExp2)*[Sales Volume],'#,##0')) as [Exp_Forecast(0.7)],

if(sum(TOTAL [Exp_Forecast(0.1)] ) > sum(TOTAL [Exp_Forecast(0.7)]),sum(TOTAL [Exp_Forecast(0.1)]),sum(TOTAL [Exp_Forecast(0.7)])) as Max_Exp

Resident T1 Order by YearMonth; 
DROP Table T1; 

Thank You

Tracy

tracycrown
Creator III
Creator III
Author

Dear Settu

Please help on my request dated Feb 11, 2016.

Thank You

Tracy