2 Replies Latest reply: Jul 7, 2011 11:35 AM by Frank Beunder

# Percentage of a subset

I have the following data:

 Day Line Type product Number 1 1 A Card 5 2 1 A Card 6 1 1 A Cash 4 2 1 A Cash 2 1 1 A Other 8 2 1 A Other 10 1 2 A Card 6 2 2 A Card 6 1 2 A Cash 8 2 2 A Cash 2 1 2 A Other 4 2 2 A Other 10

I want to create the following Chart:

 Line Type Product Total Average (per day) Product segregation(per line) 1 A Card 11 5,5 31% 1 A Cash 6 3 17% 1 A Other 18 9 51% TOTAL: 35 100% 2 A Card 12 6 33% 2 A Cash 10 5 28% 2 A Other 14 7 39% TOTAL: 36 100%

My problem is that I dont know how create a expression for the 'Product segragation' part.

The 31% should be calculated the following way:

Sum(numbers of  line 1, type A, product Card) / SUM (numbers of Line 1, type A)

In numbers:

11 / 35 = 31%

Can anyone help me?

Frank

• ###### Re: Percentage of a subset

Change the expression for the segregation to Sum(Number)/Sum(TOTAL<Line> Number)

The modfified qvw file is attached.

• ###### Percentage of a subset

Thanks for the quick response!