I want something like this as shown below where I count the # of unique category values. I was trying
count(distinct [category]) but it was not working. Any help would be great thanks!
category count
a 1
a 0
b 1
b 0
a 0
c 1
c 0
c 0
Quote from: bonfire09 on 18 Oct 2017 11:37:14 PM
I want something like this as shown below where I count the # of unique category values. I was trying
count(distinct [category]) but it was not working. Any help would be great thanks!
category count
a 1
a 0
b 1
b 0
a 0
c 1
c 0
c 0
How about total(1 for [category])
MF.
Thanks! I tried this but it did not work. Instead I brought in another column and did a running count on that grouped by the category column. IE
running-count ( [data item] for [category]) which gave counts within category, and then created a new query calculation that had a case statement that said
case
when running_count=1 then 1
else 0
end case.