Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

1 Solution

Accepted Solutions
sunny_talwar

3 Replies
sunny_talwar

Like this?

Capture.PNG

sunny_talwar

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

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

Capture.PNG

Anonymous
Not applicable
Author

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.