3 Replies Latest reply: Aug 10, 2018 1:49 PM by Vishwarath Nagaraju RSS

    script help

    Chiquita Saulsberry

      I have 3 tables

      table 1

      hub, order number, carton number, sku

       

      table 2

      hub, order_header_key, order number, sku, work order,

       

      table 3

       

      order_header_key, order number, work order, return number

       

       

       

      I need to query for the below only if it is with criteria for certain hubs

      order number, carton number, sku, work order, return number -  only if it is in table 1

       

       

      any help would be appreciated

        • Re: script help
          Vishwarath Nagaraju

          Can you elaborate below a little more clearly please...

           

          I need to query for the below only if it is with criteria for certain hubs

          order number, carton number, sku, work order, return number -  only if it is in table 1


          May be you can try below:

           

          Table1:

          LOAD *, hub&OrdNo&SKU As HubKey;

          LOAD hub,

               [Order Number]  AS OrdNo,

               [Carton Number] AS CartNo,

               SKU

          FROM Table1;

           

           

          NoConcatenate

          table2:

          LOAD hub               AS hub2,

               order_header_key,

               [order number]    AS OrdNo2,

               sku               AS sku2,

               [work order]      AS WorkOrd2

          FROM table2;

           

          LEFT JOIN(table2)

          table3:

          LOAD order_header_key,

               [order number]  AS OrdNo2,

               [work order]    AS WorkOrd2,

               [return number] AS ReturnNo3

          FROM table3;

           

           

          NoConcatenate

          Final:

          LOAD *, hub2&OrdNo2&sku2 AS HubKey

          Resident table2

          WHERE Exists(HubKey, hub2&OrdNo2&sku2);

           

          Drop Table table2;