Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Would like to calculate the cumalitive amount per employee, example is shown in below table. Challenge is that the line items per employee differ. Is it possible to calculate the cumulative amount? Appreciate your support in here.
employee | Amount | Cumulative amount |
A | 1 | 1 |
A | 2 | 3 |
A | 3 | 6 |
B | 4 | 4 |
B | 5 | 6 |
C | 2 | 2 |
C | 4 | 6 |
C | 6 | 12 |
C | 8 | 20 |
Can this be done in Qlikview?
try this
tab:
load employee,Amount,if(employee=previous(employee),
RangeSum(peek(Cumulative_Amount),Amount),Amount) as Cumulative_Amount;
load * Inline
[
employee, Amount
A, 1
A, 2
A, 3
B, 4
B, 5
C, 2
C, 4
C, 6
C, 8
];
Hi Ahidhar, thank you for your response in here. As I'm utilizing qlikview, would the formula be the same? Thanks for your response in here.
Hi
Try the following expression to get the cumulative amount
Sum(Aggr(Sum(Amount),employee))
This will aggregate the amount over the employee.
Best wishes
B
yes it will work