Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hope you good, qlik-masters and enthusiasts!
I try to write some sort of recursive expression, and can't cope with that by myself.
What we got:
- Year dimension Report_date (for simplicity I restrict it for only 5 years in example)
- Fact measure Base_value with some values
- Constant coefficient k = 0.74
What I try to make:
- expression Calc_Value.
It should work like: Calc_Value = Base_Value - Sum_All_Previous_Calc_Values * k (see below).
I've tried use RangeSum(Above(Sum(Base_value) * k, 1, RowNo()) and all stuff around that expression, but its just doesn't work.
Also I saw post Can I make a recursive calculation, where each result is used in the following calculation? , but it's doesn't work for me as well.
Here my example:
Because of variety of different data for selection in real, expression should work "on-the-fly" in front-end, not in script.
All the best, take care!
It's possible to use recursive calls, but they only work in small charts. ("Small" meaning fewer than perhaps 100 rows.)
If you define a measure "Calc_value" as
Base_value-RangeSum(Above(Calc_value,1,RowNo()))*k
then you can get
It's possible to use recursive calls, but they only work in small charts. ("Small" meaning fewer than perhaps 100 rows.)
If you define a measure "Calc_value" as
Base_value-RangeSum(Above(Calc_value,1,RowNo()))*k
then you can get
Hello, Henric!
Thank you, pure class! 👍
One thing to add: for correct calculation untick option "Suppress zero-values".