8 Replies Latest reply: Mar 20, 2018 7:00 PM by David Forest RSS

    Left join not working?

    Jonnie Yacoub

      Hi Qlikkers,

      So i'm trying to LEFT JOIN my table deal on lead, but its not giving me back the result i want... I want to visualisize all the leads and deals that have the same lead_id on one line so i can use one date as dimension and 2 counts (lead & deal)

       

      LIB CONNECT TO 'lead (-----------)';

      [lead]:

      Load

           [id] AS lead_id,

          DATE(inserted, 'DD/MM/YYYY') as lead_inserted,

          [name_last] AS lead_name_last,

          [priority] AS lead_priority,

          ApplyMap('lead_sourceMap',[source], null()) AS source,

          [owner_user] as user_id;

      SQL SELECT

      (SELECT

               "id",

              "inserted",

              "name_last",

              "priority",

              "source",

              "owner_user"

      FROM "root")

      FROM JSON (wrap on) "root";

       

      LIB CONNECT TO 'deal (-------------)';

      LEFT JOIN

      [deal]:

      Load

           [id] AS deal_id,

          DATE(inserted, 'DD/MM/YYYY') as deal_inserted,

          [lead] AS lead_id,

          [office] AS deal_office,

          [owner_user] as userid,

          [value_cents] AS deal_value_cents;

      SQL SELECT

      (SELECT

               "id",

              "inserted",

              "lead",

              "office",

              "owner_user",

              "value_cents"

      FROM "root")

      FROM JSON (wrap on) "root";