Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can someone help me on this question?
I have a table contain quite a few fields like below. Lets say two of fields are A and B. I want to calcuate sum(A*B). The question is that I expect sum(A*B) equals to 10+2+18. but it is not.
table:
---------------------------
key, A, B, A*B...
1 , 2, 5, 10,...
2 , 1, 2, 2,...
3 , 6, 3, 18,...
---------------------------
if I select key field 1, the table become like below, just have the first row.
------------------------------
key, A, B, A*B...
1 , 2, 5, 10,...
------------------------------
I expected sum(A*B) = 10. But its calcuated result is (2+1+6)*5=45.
if I did sum(B)*A it will give me 5*2=10
I am confused. Under the current selection, A should just be number 2, why when I did sum(A*B), it sum all A value (2, 1, 6)?
Thanks,
Hello!
The results reported by Qlikview is this:
Tab:
LOAD * Inline
[
key, A, B, AxB
1, 2, 5, 10
2, 1, 2, 2
3, 6, 3, 18
];
key | A | B | AxB | Sum(A*B) |
30 | ||||
1 | 2 | 5 | 10 | 10 |
2 | 1 | 2 | 2 | 2 |
3 | 6 | 3 | 18 | 18 |
key | A | B | AxB | Sum(A*B) |
10 | ||||
1 | 2 | 5 | 10 | 10 |
Felipe