6 Replies Latest reply: Jul 21, 2015 7:10 AM by Ira G RSS

    Interval match and syntethic table

      Hallo,

       

      I hope that you guys can help me or at least give a hint.

       

      I was about to create the 'bridge table' with the help of IntervalMatch:

       

      events:

      LOAD * INLINE [

          event, eventdate

          a, 12.03.2014

          b, 12.03.2015

      ];

       

      Interval:

      LOAD * INLINE [

          intervalId, begin, end, preis

          1, 01.01.2013, 01.05.2014, 65

          2, 01.01.2013, 01.05.2014, 55

          3, 02.05.2014, 31.12.2015, 75

      ];

       

      bridge:

      IntervalMatch (eventdate)

      load begin, end

      Resident Interval;

       

      Nevertheless I constantly get the synthetic table.

      I have found other discussion where the similar example is shown but without synth table...

       

      here is the data model:

      export.png

       

      Thank You in advance!

        • Re: Interval match and syntethic table
          Serhan Celebi

          Hello,

           

          Synthetic table is recommended in interval match scenarios. At least I recommend through my experience Best possible performance because if you join it into the bridge table (which you can) it multiplies the table and creates a huge one, slowing the performance eventually. As long as the result is correct, this model is best practice.

           

          You can try joining it; you can see yourself. Just write "join" before the bridge table.

           

          BR

           

          Serhan

            • Re: Interval match and syntethic table
              Friedrich Hofmann

              Hi Ira,

               

              IntervalMatch is a two-step process in fact:

              - First you use the function to join the intervals (start_date and end_date) to the distinct event_dates;

              - Then you can use those two fields (plus a key_field, optionally) to join in the price_data from the intervals_table.

              => The synthetic key after the first step is normal (you haven't yet joined) (think about it, the tables have two fields which are named the
                    same and  QlikView automatically links those, so of course you'd get a synthetic key)

               

              Serhan is completely right. Write a JOIN (or I would recommend adding the name of the table you want that to be joined to in brackets like >> JOIN (events) << before the IntervalMatch() to join that to the events_table and the synthetic key will be gone.

               

              => Then you can, in a second step, join the price_data from the intervals_table to that.

               

              HTH

            • Re: Interval match and syntethic table
              Jens Frederik Kristiansen

              Include a left join before intervalmatch to get rid of the synthetic dimension.

               

              bridge:

              LEFT JOIN (Interval)

              IntervalMatch (eventdate)

              load begin, end

              Resident Interval;

              • Re: Interval match and syntethic table

                Thank you for your answers But I have one more question... How can one avoid synthetic table, when slowly changing dimension is a case? In the example above appears synthetic table...

                 

                Thank you in advance

                 

                events:

                LOAD * INLINE [

                    event, eventdate, intervalId

                    a, 12.03.2014, 1

                    b, 12.03.2015, 3

                ];

                 

                Interval:

                LOAD * INLINE [

                    intervalId, begin, end, preis

                    1, 01.01.2013, 01.05.2014, 65

                    2, 01.01.2016, 01.05.2016, 55

                    3, 02.05.2014, 31.12.2015, 75

                    4, 02.05.2014, 31.12.2015, 85

                ];

                 

                 

                bridge:

                right join

                IntervalMatch (eventdate, intervalId)

                load begin, end, intervalId

                Resident Interval;