cancel
Showing results for 
Search instead for 
Did you mean: 

Distinct count on multiple columns

Former Member
0 Kudos

Hi guys,

Is the only solutio to count distinct values on multiple columns, to create a single field that concatenates the columns you need or is there a more elegant solution? (imagine 2 integer fields have to become a varchar because they can't be added for uniqueness )

Accepted Solutions (0)

Answers (1)

Answers (1)

amitrathi239
Active Contributor
0 Kudos

Can you plz explain in more detail and if possible with some example..

Former Member
0 Kudos

Sure. I have user_id and process_id in my fact table. I want to count the distinct values of the pair, the equivalent of SQL:

select count(*)

from (select distinct user_id, process_id from fact_table) a

amitrathi239
Active Contributor
0 Kudos

not very sure..but i think you can achieve this by creating derived table...similar to this you can create the SQL...

Former Member
0 Kudos

What do you mean with "you can create the SQL" exactly?

How would derived tables help?

Edit: You mean creating a derived table with the above code?