2 Replies Latest reply: Dec 8, 2015 10:25 AM by Jens Merle RSS

    Multiply two tables

      Hi all,

       

      I guess my problem is simply if you know how to do it... I'm trying to multiply two tables in a load script e.g. if in one table I have orders and in another table I have statuses I expect to receive for an order depending on the order type.

       

      Example:

       

      table order:

      OrderID     OrderType

      1               A

      2               B

       

      table status_expected:

      OrderType     Status

      A                    100

      A                    200

      A                    300

      B                    800

      B                    900

       

      expected output:

      OrderId     OrderType     Status

      1           A                100
      1A200
      1A300
      2B800
      2B900

       

      Thanks for your help,

      Jens

        • Re: Multiply two tables
          Massimo Grossi

          If you just want 1 table use this script (with a join)

           

          [table order]:

          load * inline [

          OrderID     OrderType

          1               A

          2               B

          ] (delimiter is spaces);

           

          left join ([table order])

          //[table status_expected]:

          load * inline [

          OrderType     Status

          A                    100

          A                    200

          A                    300

          B                    800

          B                    900

          ] (delimiter is spaces);

           

           

          You can probably get the same result without joining the 2 tables (ie no changes to your script): Qlikview will associate the 2 tables.