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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

summing across mulitple variables

I have a table that has the following columns:

DateIDCount%
5/3315x
5/33210y
5/43110z
5/43215u

I would like to sum the Count column for each combination of Date and ID so I can see the % of that day and ID that set makes up.

I want:

x = 5 / (5 + 10) = 33.33%

y = 10 / (5 + 10) = 66.66%

z = 10 / (10 + 15) = 40%

u = 15 / (10 + 15) = 60%

How do I set up the % column to do this?

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with this

     sum(Counts)/sum(Total<Date> Counts)

Celambarasan

View solution in original post

5 Replies
Not applicable
Author

Try using

sum(total Aggr(count(field),Date))

Not applicable
Author

I tried using the following:

sum(Counts)/sum(Aggr(sum(Counts),Date,ID))

This worked, but it only gave a % for the largest Count for each Date.

So in my example above:

x is NULL

y = 66.66%

z is NULL

u = 60%

How can I get the % to work for all rows?

Not applicable
Author

What is the result of the expression:

Aggr(sum(Total Counts),Date)

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with this

     sum(Counts)/sum(Total<Date> Counts)

Celambarasan

Not applicable
Author

For the example I gave, sum(Counts)/sum(Total <Date> Counts) worked

When I added another variable to the mix I then wanted to use:

sum(Counts)/sum(Total <Date,ID> Counts)

which allowed me to sum across Date and ID and Disposition