Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following table:
Range | Area | Qty |
---|---|---|
Range1 | Area1 | 3 |
Range2 | Area1 | 4 |
Range3 | Area1 | 10 |
Range4 | Area1 | 4 |
Range1 | Area2 | 8 |
Range2 | Area2 | 4 |
Range3 | Area2 | 1 |
Range4 | Area2 | 1 |
Range1 | Area3 | 6 |
Range2 | Area3 | 3 |
Range3 | Area3 | 4 |
Range4 | Area3 | 4 |
What I need is to do this:
Range | Area | Qty | Total | Var |
---|---|---|---|---|
Range1 | Area1 | 3 | 21 | 0.14 |
Range2 | Area1 | 4 | 21 | 0.19 |
Range3 | Area1 | 10 | 21 | 0.48 |
Range4 | Area1 | 4 | 21 | 0.19 |
Range1 | Area2 | 8 | 14 | 0.57 |
Range2 | Area2 | 4 | 14 | 0.29 |
Range3 | Area2 | 1 | 14 | 0.07 |
Range4 | Area2 | 1 | 14 | 0.07 |
Range1 | Area3 | 6 | 17 | 0.35 |
Range2 | Area3 | 3 | 17 | 0.18 |
Range3 | Area3 | 4 | 17 | 0.24 |
Range4 | Area3 | 4 | 17 | 0.24 |
I need to add 2 expressions:
- Total: Sum of Qty for each Area. Example: Area1 = 21 (3+4+10+4)
- Var: Qty/Total. Example: Area1, Range1 = 0.14 (3/21)
Do you know how could I do that?
Thank you!!!
Try this:
Total
Sum(TOTAL <Area> Qty)
Var
Sum(Qty)/Sum(TOTAL <Area> Qty)