Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
akmughal
Contributor II
Contributor II

Create a Multi Race category - Set Analysis

Hi Guys,

I'm trying to create a category "Multi Race" from two fields using set analysis where it sums the clients count based on their Primary and Secondary races. So, if there is a client who has two races, that client should be counted under the "Multi Race" instead of Primary Race.

Here is an example:

Client IDPrimary RaceSecondary Race
1White-
4WhiteBlack
5BlackAmerican Indian
6Asian-
8Black-
9American Indian-
12White-
13White-
14BlackWhite
9Total Client 

 

How would I create a set analysis statement to create a below table?

 

Race CategoryClient Count
White3
Black1
Asian1
American Indian1
Multi Race3
Total9

 

Thank you,

akmughal

 

 

 

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

This could not be done with set analysis, but may be done with if() using a calculated dimension like:

Aggr(if(len([Secondary Race], 'Multi Race', [Primary Race]), [Client Id])

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com