Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have several Race fields that should be combined into one common field since they have a common attributes.
The problem is how do I combine the Six fields when they have a Y/N value for each one and map it to the label of the fields?
Current Schema:
Field | Value |
Race: White | Y/N |
Race: Black | Y/N |
Race: Hispanic | Y/N |
Race : Asian | Y/N |
Race : Indian | Y/N |
Race: Other | Y/N |
Convert to This: | |
Values | |
Race | White |
Black | |
Hispanic | |
Asian | |
Indian | |
Other |
Hi,
Please explain the field names or you can use subfield here
This data in which two fields
Current Schema:
Race: White | Y/N |
Race: Black | Y/N |
Race: Hispanic | Y/N |
Race : Asian | Y/N |
Race : Indian | Y/N |
Race: Other | Y/N |
Regards
Anand
If I have 6 fields that have 6 Y/N values I want to convert them into one field that has the descriptions instead.
I can create a mapping table as well to help.
Would like the data to be stored like this.
Field | Value |
Race | White |
Black | |
Hispanic | |
Asian | |
Indian | |
Other |
Can you explain with table structure that will be great.
Regards
Anand
You may use a crosstable-approach, but with this limited amount of criteria, would go with a plain approach:
Data:
LOAD
Attrib1,
Attrib2,
IF(IsWhite = 'y', 'White') & IF(IsBlack = 'y', 'Black') & IF(IsIndian = 'y', 'Indian') AS Race
INLINE [Attrib1, Attrib2, IsWhite, IsBlack, IsIndian
a, aa, y, n, n
b, bb, y, n, n
c, cc, n, y, n
d, dd, n, n, y];
HTH Peter