Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Flag creation

Hi Folks,

I have two tables and these tables have 2 fields are common. Table1 have all the values and Table2 have only some data. I attached some sample text data for my tables. In execl sheet contains table1, table2  and output Table.

I need to create Flag Y or N, If both tables have the same values then the Flag is Y otherwise N. Please find the excel sheet, we can easily understand my requirement.

Please help me in this,

Thanks & Regards,

Siri

1 Reply
swuehl
MVP
MVP

Siri,

not sure if this fits your needs, but I think you can join the two tables and create a new field for the ArmorRecipeAvailable, like

Table1:

LOAD mrecipe_id,

     RecipeName,

     RecipeNameSpace

FROM [test_data.xls] (biff, embedded labels, table is Table1$);

Table2:

left join (Table1) LOAD RecipeName,

     RecipeNameSpace,

     Status,

     1 as ArmorRecipeAvailable

FROM [test_data.xls] (biff, embedded labels, table is Table2$);

Output:

Noconcatenate LOAD mrecipe_id,RecipeName, RecipeNameSpace,Status, if(len(ArmorRecipeAvailable),'Y','N') as ArmorRecipeAvailable Resident Table1;

drop table Table1;