Generate multiple rows for a binary number field?

Status
Not open for further replies.
G

Griven

Guest
Example data rows:

| ID | First Name | Last Name | Federal Race Code |
| 101 | Bob | Miller | 01010 |
| 102 | Daniel | Smith | 00011 |


The "Federal Race Code" field contains binary data, and each "1" is used to determine if a particular check box is set on a particular web form. E.g., the first bit is American Indian, second bit is Asian, third bit is African American, fourth is Pacific Islander, and the fifth is White.

I need to generate a separate row for each bit that is set to "1". So, given the example above, I need to generate output that looks like this:

| ID | First Name | Last Name | Mapped Race Name |
| 101 | Bob | Miller | Asian |
| 101 | Bob | Miller | African American |
| 102 | Daniel | Smith | Pacific Islander |
| 102 | Daniel | Smith | White |


Any tips or ideas on how to go about this?

Continue reading...
 
Status
Not open for further replies.
Top