Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Relative prices in pivot table

I hope you can help me with these.

I have a pivot table with the following: Company/Brand/Price.

Price calculated from Sales/units

I want to take one of those prices and show the relative price to it, like shown in the next table (i take Brand 1 as the value i want to make relative prices to)

CompanyBrandPriceRelative Price
Company 1Brand 15,3100%
Company 1Brand 2475%
Company 2Brand 3357%
Company 2Brand 46113%
Company 2Brand 5238%
Company 2Brand 6594%
Company 3Brand 7119%
Company 3Brand 87132%
Company 3Brand 9357%

When i try to do it in Qlikview with the next expression, it only shows the first brand, nothing else.

(Sum({$<VARIABLES>} SALES)/Sum({$<VARIABLES>} UNIT)) / (Sum({$<VARIABLES, BRAND 1>} SALES)/Sum({$<VARIABLES,BRAND 1>} UNIT)).

Please help.

thanks

Labels (1)
3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Create a variable vIndexPrice as =sum({<BRAND={'Brand 1'}>} SALES)/sum({<BRAND={'Brand 1'}>} UNITS).

Then use the variable in the expression: (sum(SALES)/sum(UNITS)) / $(vIndexPrice)

Replace SALES, UNITS and BRAND with the correct field names of your document.


talk is cheap, supply exceeds demand
Not applicable
Author

I've tried both, but it is always the same. In my table only appears Brand 1.

Not applicable
Author

I still have problems trying to fix this. Does anyone have a clue?