5 Replies Latest reply: May 4, 2012 1:51 PM by Jeremy Boyer

# 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?

• ###### summing across mulitple variables

Try using

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

• ###### summing across mulitple variables

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?

• ###### Re: summing across mulitple variables

What is the result of the expression:

Aggr(sum(Total Counts),Date)

• ###### summing across mulitple variables

Hi,

Check with this

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

Celambarasan

• ###### summing across mulitple variables

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