Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table that has the following columns:
Date | ID | Count | % |
---|---|---|---|
5/3 | 31 | 5 | x |
5/3 | 32 | 10 | y |
5/4 | 31 | 10 | z |
5/4 | 32 | 15 | u |
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?
Try using
sum(total Aggr(count(field),Date))
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?
What is the result of the expression:
Aggr(sum(Total Counts),Date)
Hi,
Check with this
sum(Counts)/sum(Total<Date> Counts)
Celambarasan
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