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

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

11 Replies
SunilChauhan
Champion
Champion

May be like this

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

/

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

Sunil Chauhan
Not applicable
Author

nope;

this doesn't work

i think, i must add:

total <Store>

somewhere,

but it isn't clear to me where exactly.

SunilChauhan
Champion
Champion

i am not sure might be this one

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

/sum(total <Store>AmoutOfDiscount)

Sunil Chauhan
Not applicable
Author

could be this?

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

/

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

Not applicable
Author

hi,

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

Anonymous
Not applicable
Author

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

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Try this.

   

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

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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

Not applicable
Author

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