Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need solution to display RGB

File IDIndicator1Indicator2Indicator3
ABCNAyNA
cdeGNANA
efgnanaR

I want to display 2 columns FILE ID and RGB

File ID     RGB

ABC         y

CDE        G

EFG         R

Each file ID has to pick the Indicator with R/Y/G by ignoring NA.hOW CAN i DO THAT ?tHANK YOU.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can try this.

Data:

LOAD * inline [

FileID, Indicator1, Indicator2, Indicator3

ABC, NA, y, NA

cde, G, NA, NA

efg, na, na, R

];

Load FileID as FID, PurgeChar(Indicator1&'-'&Indicator2&'-'&Indicator3,'-NAna') as New

Resident Data;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can try this.

Data:

LOAD * inline [

FileID, Indicator1, Indicator2, Indicator3

ABC, NA, y, NA

cde, G, NA, NA

efg, na, na, R

];

Load FileID as FID, PurgeChar(Indicator1&'-'&Indicator2&'-'&Indicator3,'-NAna') as New

Resident Data;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Peter_Cammaert
Partner - Champion III
Partner - Champion III

A very straightforward solution but maybe not the best:

SingleColumn:

LOAD UPPER([File ID]) AS [FILE ID],

     if (UPPER(Indicator1) <> 'NA', Indicator1,

         if (UPPER(Indicator2) <> 'NA', Indicator2, Indicator3)) AS RGB

RESIDENT OriginalTable;


BTW: watch your names. Field names are case-sensitive. Your OP contains three different spellings for field File ID.


Not applicable
Author

Awesome Kaushik.This did the magic.Thank you and I appreciate your time