Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I calculate the ratio of a sum total by each number of rows.

Capture.PNG

I want to get the ratio of total Store Sales ie 15.32M by each store sales. How can I get this division?

I tried putting the total Sales in a variable and then divided by using aggr function: Aggr(Sum(UNITS),STR_ACCOUNT_NAME_DESC).

I'm not getting the correct answer. I need it 15.32M/ Sales of store 1,Store 2 and so on in the table

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Sum(UNITS)/Sum(TOTAL UNITS)

or

Sum(TOTAL UNITS)/Sum(UNITS)

View solution in original post

5 Replies
sunny_talwar

May be this:

Sum(UNITS)/Sum(TOTAL UNITS)

or

Sum(TOTAL UNITS)/Sum(UNITS)

Anonymous
Not applicable
Author

Hi

try this !!!

Sum(Store Sales) /

  Max(TOTAL Aggr(Sum(Store Sales),STR_ACCOUNT_NAME_DESC) ))


OR

  Max(TOTAL Aggr(Sum(Store Sales),STR_ACCOUNT_NAME_DESC) ))/Sum(Store Sales)




Not applicable
Author

Many Thanks, It worked

sunny_talwar

Did you mark you own answer as correct by mistake .

I would suggest marking the response which is actually correct, so that future users can find it useful when they land on this page.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny

Not applicable
Author

Oops Sorry, My bad. I corrected my mistake.