3 Replies Latest reply on Jan 21, 2019 2:05 AM by Mahfooj Khan

# distinct count of record based on a 1 and 0 columns

Dear All Tableau savvy,

Could anyone please help me with my calculation? I was playing around with my FIXED formula but looks like nothing is working so far.

 ID Group Yes No 1 A 1 2 B 1 1 3 C 1 4 C 1 5 A 1 1 6 A 1 7 A 1 8 B 1 9 C 1 10 D 1 11 A 12 B 1

Group A, for example, has 3 YES (id no 1,5,7) and 2 NO (id no 5,6). Basically, I wanted to get a distinct count of all columns where value = 1. if there is overlapping, they should be 1 only, but my formula returns 2 so it looks like i have more records. For group a, the total count should be 4 (distinct ids) and not 5).

Can you please guide me with the correct formula. Thanks so much.

• ###### 1. Re: distinct count of record based on a 1 and 0 columns

Hi,

Is that what you wanted?

{FIXED [Group]:SUM(IIF(NOT ISNULL([Yes]) OR NOT ISNULL([No]),1,0))}

Let us know if this help.

Mahfooj

1 of 1 people found this helpful
• ###### 2. Re: distinct count of record based on a 1 and 0 columns

Thanks, i copied your formula, tweak a little and it worked. Thanks very much.

Regards,

Jhun