Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum Total Conditional

Hi,

I am trying to write a formula to calculate Market Share:

sum(if(Condition=1,Units))/sum(Total{<Condition={1},competitor>}Units)

The first part of formula(Numerator) is working. However when i use total condition in next part(denominator) it fetches no result. How can i modify the same to apply both condition?

Thanks.

Labels (1)
8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try This:

sum(if(Condition=1,Units))

/

sum({$ <Condition={1},competitor=>} Total Units)

... and let me know

sujeetsingh
Master III
Master III

Try removing the total

maxgro
MVP
MVP

sum( {$ <Condition={1}>} Units)

/

sum({$ <Condition={1},competitor=>} Total Units)

Not applicable
Author

It doesn’t work ☹

Not applicable
Author

It doesn’t work ☹

alexandros17
Partner - Champion III
Partner - Champion III

... so explain better what is your aim:

why do you use competitor field only in the denominator? Try with this expression for the denominator

sum({$ <Condition={1}>} Total Units) ... if it works you have to understand the problem related to competitor.

Hope it helps

Not applicable
Author

The first part of formula works. I am using competitor in the denominator because i want to total the unit sales competitor wise.

alexandros17
Partner - Champion III
Partner - Champion III

Ok, then try the expression for the denominator without competitor as I suggested in the previous message and let me know