Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Resolving multiple (bool) columns into one field

Hello everyone,

I've spent some time browsing through the forum but couldn't find a solution for my problem.

I'm connecting to a Oracle database to consum among others 2 tables:

Tbl_Data:

IDA1A2A3A4
1true(null)trueGermany
2truetrue(null)Spain

Tbl_Attributes:

IDNameDataCOL
1Area.Highwaya1
2Weather.Sunnya2
3Weather.Raina3
4Countrya4

Almost all columns in Tbl_Data are something A1-A(n) with either a boolean value or a string. Tbl_Attributes is providing a mapping for A(n) to actual column name/content. Especially demanding is the fact that those tables still dynamically grow and I can't really map it hardcoded i.e. not all A(n) columns are already assigned in Tbl_Attributes.

As of now I'm checking wether a column has a true value via if Statements and then joining belonging entries into one field:

//Weather

    If(A5 = 'true', 'Clear',

    If(A11 = 'true', 'Cloudy',

    If(A12 = 'true', 'Rain',

    If(A16 = 'true', 'Spray',

    If(A17 = 'true', 'Sun',

    If(A18 = 'true', 'Fog',

    If(A19 = 'true', 'Snow',

    If(A20 = 'true', 'Extreme'

    )))))))) As Weather

In addition to that I also map columns with string values to Display the correct field name:

Mapping:

Mapping Load
DataCOL,
NAME;
SQL SELECT DataCOL,
    NAME
FROM Tbl_Attributes;

Rename Fields using Mapping;

So my question: is there anyway to map this in a dynamic way based on Tbl_Attributes and also join columns with true into one field e.g. Weather.Rain / Weather.Snow to a field Weather containing: rain, snow etc.

Thanks in advance

1 Reply
marcus_sommer

I would probably transform the Tbl_Data perThe Crosstable Load and then joining/mapping or associating it with the Tbl_Attributes.

- Marcus