Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey all, I'm trying to calculate a formula that uses a summation and I don't know the best way to tackle this. I've played around with loops in the load script and using the aggr() function but can't seem to get it right.
I have three variables that I already have calculated: cash flow (CF), interest rate ( i ) and number of periods (n).
The formula mathematically looks like:
Σ ( t * CF) / ((1 + i ) ^ t )
from t=1 to n
If anyone has dealt with this kind of formula before in Qlik I'd greatly appreciate some help. Thank you!
sum(valueloop(1, n)*CF/pow(1+i),valueloop(1,n))
You may also want to have a look in the HELP at the Financial Aggregation Functions in Charts,
namely npv() and xnpv() might be of interest.