Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
Not applicable
Author

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

View solution in original post

3 Replies
Not applicable
Author

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

Not applicable
Author

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,

Not applicable
Author

Ivan and Nigel,

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

rob