3 Replies Latest reply: Apr 7, 2010 12:22 PM by Rob Schipull

# Dividing rows by unique customer total

I'm trying to do a calculation, in a straight table, that counts the number of customers by a particular category. A person can show up in multiple categories. I want the denominator to be based on the total number of unique customers and the numerator to be based on the total in that particular category. I'm guessing I'd do something with the aggr function or set analysis, but I can't seem to get the correct answer. Any help is much appreciated.

I've attached a sample qvw as reference.

thanks,

rob

• ###### Dividing rows by unique customer total

Hello Rob, enclosed you will find the expected values, the solution was quite simple so I do not know if this is what you where expecting.

Regards

• ###### Dividing rows by unique customer total

Hi Rob

Simple solution to this one, you simply need to add the "Total" identifier to your expression for % of Total as follows:

`=count(distinct customer_id)/count(total distinct customer_id)`

Hope it helps,

• ###### Dividing rows by unique customer total

Ivan and Nigel,

Thank you both for taking the time to provide your solutions. I thought it might be something I was missing.

rob