Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I want to create a simple table in QLIK. I am starting to get the hang of QLIK, but I can't seem to do what I want, even though it seems very simple to me. I want to create a table with the years and the cost, and a third column with the cumulative cost of the previous three years for the year in the row. I have a field [Date comptable_ ANNEE] and a field Total_des_couts for the cost.
I have entered the dimension [Date comptable_ ANNEE] and the measure sum(Total_des_couts).
However, when I fill in the third column to get the cumulative calculation, it doesn't work because it only takes the result for the current year...
I've tried several syntaxes
- Sum(
{<
[Date comptable_ ANNEE] = {">=$(=Max([Date comptable_ ANNEE])-3) <=$(=Max([Date comptable_ ANNEE])-1)"}
>} Total_des_couts
)
but I can't get it to work, the result is 0. Here's what I want in the attachment: If anyone has a solution without creating new fields in a script, that would be great... Thanks in advance.
in your example the last line is 360, but I believe it is 460 according to the above values.
So try this:
IF(RowNo(TOTAL)=1,'', RangeSum(Above(Sum(Total_des_couts), 1 )))
- Regards
Is there any other solution than the above function as it depends on the year sorting?
thanks for advance
Try this
RangeSum(
Above(Sum(Total_des_couts), 0, 3)
)
That's why I look for the accumulation outside of the modifier, so in this case, see it like this.
max(aggr(RangeSum(Above(Sum(Total_des_couts), 1 ,RowNo())),([Date comptable_ ANNEE],(=Sum(Total_des_couts),Cresc))))