Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I have a pivot table with products (y) and wholesalers (x) with percentage-values.
But Qlikview is putting the total on 100%, but it isn't ...
For instance:
| Product | Wholesaler A |
| Product A | 35% |
| Product B | 2% |
| Product C | 5% |
| Product D | 1% |
| Product E | 7% |
| Product E | 58% |
| Total | 100% |
It says total 100% at the bottom, where I expected 108%.
What am I doing wrong?
My expression for the percentages are as follow
=
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=>} [Customer Weight])
/
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=, [Product Group]=>} TOTAL <"$(=GetCurrentField(Wholesaler))"> [Customer Weight])
Sincerely Yours,
Vincent Hayward
I think I have fixed this with the following statement:
=sum(aggr(
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=>} [Customer Weight])
/
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=, [Product Group]=>} TOTAL <"$(=GetCurrentField(Wholesaler))"> [Customer Weight]),
[Product Group],
"$(=GetCurrentField(Wholesaler))"
))
Or are there more options to fix this one?
In straight table, the total is calculated as "total of the expression".
To have the total of the column, you can do like this:
sum
(aggr(value,Dimension))
For you, I think:
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=>} aggr([Customer Weight],Product))
/
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=, [Product Group]=>} TOTAL <"$(=GetCurrentField(Wholesaler))"> aggr([Customer Weight],Product))
I think I have fixed this with the following statement:
=sum(aggr(
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=>} [Customer Weight])
/
sum( {$<QuarterID={"<=$(=max(QuarterID))>=$(=max(QuarterID)-3)"}, [Year-Quarter]=, [Product Group]=>} TOTAL <"$(=GetCurrentField(Wholesaler))"> [Customer Weight]),
[Product Group],
"$(=GetCurrentField(Wholesaler))"
))
Or are there more options to fix this one?