Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

zippywonderslug
New Contributor

Creating an Exponential Decay

I am attempting to create a calculation that uses an exponential decay. In Excel, this is very easy since I can reference the cell that was calculated above the cell that is currently being calculated. Here is what it looks like in Excel.

  

Exponential Rate of Decay0.6
Decay Calculation=Current Balance * EXP(- Rate of Decay / 12)
DateBalance
1/1/2016100.00
1/2/201695.12
1/3/201690.48
1/4/201686.07
1/5/201681.87
1/6/201677.88
1/7/201674.08
1/8/201670.47
1/9/201667.03
1/10/201663.76
1/11/201660.65
1/12/201657.69

I have tried the above() function but it will not calculate the values. I am guessing since there is a calculation inside of a calculation it is getting lost. Here is the calc:

            above((Sum([Static Raw Value])/Sum([Static Number of Sites])/Sum([Static Number of Days In Month]))

            *exp(-.6/12))*exp(-0.6/12)

Anyone have any ideas? Any help would be appreciated.

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Creating an Exponential Decay

Like this?

Capture.PNG

3 Replies
MVP
MVP

Re: Creating an Exponential Decay

Like this?

Capture.PNG

MVP
MVP

Re: Creating an Exponential Decay

or may be this where vDecay can be changed by the users

=Alt((Above(Expression) * Exp(-vDecay/12)), Value)

Capture.PNG

zippywonderslug
New Contributor

Re: Creating an Exponential Decay

Sunny,

Thanks that worked perfectly. Qlik Sense gives an error on the expression but will execute with the correct answer anyway.

Thanks for the help.

Here is the final expression:

alt((above(Exponential))*exp(-.6/12),(Sum([Static Raw Value])/Sum([Static Number of Sites])/Sum([Static Number of Days In Month])))

FYI, "Exponential" is the name of the column that this expression resides in.