11 Replies Latest reply: Sep 1, 2011 5:11 AM by Joseph Simmons

# Problem with "Total"

Dear QV-Designers,

I want to calculate the ratio of the discount per "employee"

therefore i use the expression:

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} AmoutOfDiscount

These expression works fine.

I want to divide the mentioned expression by the total amount of discount of the store,

but i dont know how to handle this.

Thanks in advance for any help.

so long

daniel

• ###### Problem with "Total"

May be like this

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} AmoutOfDiscount)

/

SUM ( { <TypeOfVoucher={'Store'} , DiscountID = {'Reduction'} >} AmoutOfDiscount)

• ###### Re: Problem with "Total"

nope;

this doesn't work

total <Store>

somewhere,

but it isn't clear to me where exactly.

• ###### Problem with "Total"

i am not sure might be this one

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} AmoutOfDiscount)

/sum(total <Store>AmoutOfDiscount)

• ###### Problem with "Total"

could be this?

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} AmoutOfDiscount)

/

SUM ( TOTAL { <TypeOfVoucher={'Store'} , DiscountID = {'Reduction'} >} AmoutOfDiscount)

• ###### Problem with "Total"

hi,

i just tried the two described solutions shown up, and it didn't work

• ###### Problem with "Total"

substitute sum(TOTAL ....   with    sum( {1}...

• ###### Problem with "Total"

Hi,

Try this.

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} AmoutOfDiscount) /

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} Total AmoutOfDiscount)

Regards,

Kaushik Solanki

• ###### Problem with "Total"

hi,

unforunately the formula still doesn't work right.

but the solution of Kaushik seems to be one step closer to the disered goal.

regards

daniel

• ###### Problem with "Total"

Hi,

I think you need to expand the set analysis on the bottom line of the expression Kaushik posted, so that the employee field is ignored and it's able to grab the total for the whole store

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} AmoutOfDiscount) /

SUM ( { <TypeOfVoucher={'Sale'} ,[your empoyee field here] =, DiscountID = {'Reduction'} >} Total AmoutOfDiscount)

as at present I think it is just grabbing the total for the empoyee

hope that helps

thanks

Joe

• ###### Problem with "Total"

Hi Joe,

the diagramm is a "pivot table"

so that the empolyee-number, shop-number and  a time-scale  is used to creat this "pivot".

But I want to show a ratio of the "reduction per employee in relation to the total reduction of the whole shop".

greets

daniel

• ###### Problem with "Total"

Hi Daniel,

that is what I thought, you will still need to put the employee-number in your set analysis in order to get the correct total, as it stands if you don't put that extra set analysis in the total part of your expression it won't know to ignore the employee-number and so give you the wrong total

SUM ( { <TypeOfVoucher={'Sale'} , DiscountID = {'Reduction'} >} AmoutOfDiscount) /

SUM ( { <TypeOfVoucher={'Sale'} ,[employee-number] =, DiscountID = {'Reduction'} >} Total AmoutOfDiscount)

thanks

Joe