Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to get total for a certain level

Hi There,

I have got a question regarding how to get total value for a certain level.

For Example,

I have the table  as followings:

ALU    COLOR  STYLE SIZE  30DAY SALE Inventory  Months Supply

00001   blue       2001     M      20                  100          5

00002   white     2001     L       10                   30           3

If I want to calculate the months supply in style level, meaning that we can ignore the difference of ALU, COLOR and SIZE.

So the style level months supply is (100+30)/(20+10)=4.33

How can I form a expression of this?

Thank you so much!

Best Regards,

Gloria

3 Replies
maxgro
MVP
MVP

with total and angle brackets

sum (total <STYLE> Inventory)  / sum (total <STYLE> [ 30DAY SALE])

Not applicable
Author

Hi Massimo,

Thank you for your reply. However, this method doesn't give me the correct result. I don't know what went wrong. Is there any other way to get the same result above?

Thank you so much!

Best Regards,

Gloria

Anonymous
Not applicable
Author

may be a sample qvw will help fix it...because Massimo's expression works for me.

145503.png