I want to calculate distinct count by group. When i tried to create aggregate measure and use distinct count, it returns an error as variable is character (see the variable 'code' below)
ID |
flag |
Code |
1 |
0 |
B1 |
1 |
0 |
B1 |
1 |
0 |
B2 |
1 |
1 |
A1 |
1 |
1 |
A1 |
1 |
1 |
A1 |
2 |
0 |
D1 |
2 |
0 |
D1 |
2 |
1 |
C1 |
2 |
1 |
C1 |
I want to generate the following output in cross tab. For ID =1, it should return this output (i.e. distinct count of variable 'Code'.
I would put ID in the drop down.