3 Replies Latest reply: Apr 20, 2015 9:24 AM by Tobias Meyer RSS

    how to merge 2 different sources

      Hi guys,

      I have 2 Sources

      S1: //actual

      Load  Keynr1,

           Date

      Resident X

       

      S2: //archieved

      Load Keynr2,

           Versionnr,

           Date

      Resident Y

      ------

      I want to have  a clear table with distinct keynr, becaus in S2 (archieved) are some Keynr from S1 ..

      and in S2 are many Versions of Keynr2s.. so I need only the lastest Version of each Keynr2

       

      So I've tried:

      All:

      //actual

      Load  Keynr1,

           Date

      Resident X

      JOIN

      //archieved

      Load Keynr2,

           Versionnr,

           Date

      Resident Y

       

       

      1: //(1only)

      Load Keynr1, Date

           Resident All Where not exists(Keynr2)

      2: //(1&2only)

      Load Keynr2,Date,max(Versionnr) as Versionnr

              Resident All Where exists(Keynr1) and exists(Keynr2) Group by Keynr2, Date, Versionnr;

      3: //(2only)

      Load Keynr2 as Keynr3, Date, Max(Versionnr) as Versionnr

           Resident All Where not exists(Keynr1) group by Keynr2, Date, Versionr;

       

       

      Is that right?

      I dont get the 2. table (1&2only)..

      can you explain me, and tell me how to filter that ?