2 Replies Latest reply: Jun 17, 2012 11:57 PM by Boris Gerchikov RSS

    HOW TO SOLVE THIS LOOP?

      Dear All,

       

      See example

      How can I solve this loop problem without  creating synthetic links (performance reasons)??

       

      All Help is highly appreciated

        • Re: HOW TO SOLVE THIS LOOP?
          Jonathan Dienst

          Hi

           

          The loop is because the 2nd interval match create a new table (Pat-1) as there is no join statement. Was that intentional, or should that interval match be joined to the Pat table?

           

          Regards

          Jonathan

          • Re: HOW TO SOLVE THIS LOOP?
            Boris Gerchikov

            To avoid the loop you need to join Pat and Empl tables.

             

            The logic should be as follows:

            1. join Pat and Empl tables.
            2. Intervalmatch statement
            3. Eliminate synthetic keys using the technic below:

             

            inner JOIN (Calender)

            IntervalMatch (Date)

            LOAD

            Start, End

            Resident Pat;

            CalenderTemp:

            NoConcatenate LOAD *,
            Start&'-'&End as CompStartEnd

            Resident Calender

            ;


            PatTemp:

            NoConcatenate LOAD *,

            Start&'-'&End as CompStartEnd

            Resident Pat

            ;

            drop Tables Calender,Pat;

            drop Fields Start,End;

            RENAME Table CalenderTemp to Calender;



            RENAME Table PatTemp to Pat;

            If you cannot join Pat and Empl tables - then create the same logic for Empl table and rename date field in one of them.