4 Replies Latest reply: Dec 8, 2014 4:33 PM by Peter Rieper

# Combine multiple fields into one common field

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
• ###### Re: Combine multiple fields into one common field

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

• ###### Re: Combine multiple fields into one common field

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
• ###### Re: Combine multiple fields into one common field

Can you explain with table structure that will be great.

Regards

Anand

• ###### Re: Combine multiple fields into one common field

You may use a crosstable-approach, but with this limited amount of criteria, would go with a plain approach:

Data:

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