1 Reply Latest reply: May 8, 2012 3:03 PM by Stefan Wühl RSS

    Flag creation

    Srikanth P

      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

        • Re: Flag creation
          Stefan Wühl

          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;