3 Replies Latest reply: Dec 11, 2014 6:46 PM by Saradhi Balla

# 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

• ###### Re: how to get total for a certain level

with total and angle brackets

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

• ###### Re: how to get total for a certain level

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

• ###### Re: how to get total for a certain level

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