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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
chriscools
Creator II
Creator II

calculate line% of total of the same column

Hello,

i have a table for sales per shop, article in the dimension and as an expression: Sum (if ( Shop='Pomax Store Knokke',  LineSalesAmount))

now i want to include a second column indicating the relative importance of the article meaning

the % that is the amount per article versus the total amount for that column  (= amount of all the articles).

probably this will be very easy, but i can't seem to figure it out...

can someone help me?

thanx!!!

grtz,

chris

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

Add the same expression agaian and for the second expression, check the 'Relative' checkbox.

View solution in original post

6 Replies
Jason_Michaelides
Partner - Master II
Partner - Master II

Firstly, change your first expression for the better-performing set analysis option:

Sum({<Shop={'Pomax Store Knokke'}>} LineSalesAmount)

Then, for your second expression:

Sum({<Shop={'Pomax Store Knokke'}>} LineSalesAmount)

/

Sum(TOTAL {<Shop={'Pomax Store Knokke'}>} LineSalesAmount)

Hope this helps,

Jason

nagaiank
Specialist III
Specialist III

Add the same expression agaian and for the second expression, check the 'Relative' checkbox.

chriscools
Creator II
Creator II
Author

thank you very much!

your solution works fine!

but when you say the set analysis is better performing, why is this?

thanx!

chris

chriscools
Creator II
Creator II
Author

thanx! this was a real easy solution!! 🙂

Jason_Michaelides
Partner - Master II
Partner - Master II

You should read up on Set Analysis both in the reference guide and on this forum.  In simplistic terms, using IF() means QlikView has to evaluate every row to find values to use.  Set Analysis uses Set Theory, which I don't really understand but means that not every row needs to be checked, therefore it's normally significantly faster, especially over large data sets.

chriscools
Creator II
Creator II
Author

thanx! i'll follow youre advise and do some reading on this!

grzt,

chris