Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am fairly new to Qlik Sense and looking for some help, I am currently struggling to calculate a % in a pivot or straight table.
I have a list of sales products as one dimension and country codes (origins) where those products are sourced from as the second dimension. The calculation itself works, if I select a single sales product the %'s truly reflect what the background data is suggesting. The issue I am having is when viewing the full list of products the %'s are being calculated across all parts and all origins.
In simple (excel) terms, I need to anchor the calculation to the sales product.
I have attached two excel files, with the Incorrect view and the Correct view.
My expression syntax is currently as follows:
SUM({$<COUNTRY_DB>}INVENTORY_QTY_ISSUED-INVENTORY_QTY_UNISSUED) / SUM(${<COUNTRY_DB>} Total (INVENTORY_QTY_ISSUED-INVENTORY_QTY_UNISSUED))
Any help (and brief explanation of where I am going wrong) would be gratefully received.
Many thanks,
Matt
Try this
Sum({$<COUNTRY_DB>}INVENTORY_QTY_ISSUED-INVENTORY_QTY_UNISSUED) / Sum(${<COUNTRY_DB>} TOTAL <[Sales Part Description]> (INVENTORY_QTY_ISSUED-INVENTORY_QTY_UNISSUED))
Thanks Sunny, I am sure I tried this or a variation of it, perhaps I got it wrong but I am glad to say that this has worked. It is stating that there is an error in the expressions but the figures check out so many thanks.
Much appreciated.
Matt
May be error here
Sum({$<COUNTRY_DB>}INVENTORY_QTY_ISSUED-INVENTORY_QTY_UNISSUED) / Sum(${$<COUNTRY_DB>} TOTAL <[Sales Part Description]> (INVENTORY_QTY_ISSUED-INVENTORY_QTY_UNISSUED))
Well spotted Anil
Thank you both, works a treat.