Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts
I need to calculate the subtotal of the following example:
Currently I have the logic for Total but I need to subtotal:
Sum({<Year={'2021'}, [Goods Receipt]={'X'}>} TOTAL <[Vendor Key]> [Sales])
Any ideas?
Thank you, Tom.
Thank you
I don't need a running total, I need a subtotal on (distinct) vendor. But I tried your proposals, it is not giving any results:
Aggr(RangeSum(Above(TOTAL Sum([Sales]), 0,RowNo())), <[Vendor Key]>)
Any further ideas?
Many thanks
Tom
I think your formula for the total by vendor is already correct, though that one would repeat for each line rather than showing up once. You might be able to use Below() to only show it once, but this may cause erratic behavior if you also have suppress 0 / null enabled due to the way Qlik handles the combination thereof. It'd look something like:
If(Only(Vendor) <> Below(Only(Vendor)),Sum({<Year={'2021'}, [Goods Receipt]={'X'}>} TOTAL <[Vendor Key]> [Sales]))