Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
i have a pivot table in which i want to calculate a cumulative total.
there are two dimensions : group and product
there are two columns : qty, whiwh is a quantity, and rank whiwh is the rank.
I want to compute the cumulative total of qty.
in the example given, there are 3 totals
1st value = 492128
2nd = 213630
3rd = 460939
the need is to have
1st = 492128
2nd = 492128+213630
3rd = 492128+213630+460939
as read in the community, i tried the above fucntion, bur it seems to work only at the detail level, not with dimensions
Try this expression:
if(Dimensionality()=1, sum(aggr(rangesum(above( sum(total <Groupe> QTECDE),0,RowNo())),Groupe)), sum(QTECDE))
Thank you Gysbert below works
if(Dimensionality()=1, sum(aggr(rangesum(above( sum(total <Group> QTECDE),0,RowNo())),Group)), sum(QTECDE))
Please see my example below
my expression is
Sales=sum(SalesAmount)
Cummulatie Sale=
if(Dimensionality()=1, sum(aggr(rangesum(above(sum(total <Order_Year> SalesAmount),0,RowNo())),Order_Year)), sum(SalesAmount))
i already tried something like that.
with the code, the result is shown below.
the qtys seems to be multiplied by 3 for the 1st ctageory, by 2 for the 2ns, and by a lot for the 3rd
Post a small qlikview document that demonstrates the problem.
i forgot to explain that my 2 dimensions are computed if this way
so i can't use total <Groupe> in the formula
What is your expression ?
Are you doing aggregation and subtotaling on Group dimension in expression like
if(Dimensionality()=1, sum(aggr(rangesum(above( sum(total <Group> QTECDE),0,RowNo())),Group)), sum(QTECDE)) ?
i tried
if(Dimensionality()=1, sum(aggr(rangesum(above( sum(total <Groupe> QTECDE),0,RowNo())),Groupe)), sum(QTECDE))
but it doesn't work as Groupe is a computed dimension (i think so)
did you see the application i posted ? (if not, please tell me the correct way to post it )
Then what you want cannot be done afaik. At least not with doing the calculations in the script and creating the necessary fields there.
here is the application