3 Replies Latest reply: Apr 16, 2015 10:07 AM by Sjoerd Stilma RSS

    Linking Dates issue

      Hello people, I've read some topics about linking dates. Now I want to do something more 'advanced'. I obtained a Qlikview example  of the basics. It looks like this:

      Basic.png

      In order to create the Link table, this script is used:

       

      Link:

      LOAD

      ID

      ,CreatedDate as Date

      ,'Created' as DateType

      RESIDENT Table1

      ;

      CONCATENATE (Link)

      LOAD

      ID

      ,DepartureDate as Date

      ,'Departure' as DateType

      RESIDENT Table2

      ;

      CONCATENATE (Link)

      LOAD

      OtherID

      ,OtherDate as Date

      ,'Other' as DateType

      RESIDENT OtherTable

      ;

       

       

      Okay from here all fine! Now I want to something like this:

       

      BasicPlus.png

       

      Is it possible to make the Link table obtain the DepartureDate from Table3, since it is now not directly connected? If so how would I script that?

      Help is much appreciated!

        • Re: Linking Dates issue
          Shiva Reddy

          pls share ur qvw,tht's helps to answer ur query quickly.

          • Re: Linking Dates issue
            Rudolf Linder

            I suppose that you have to use a 2 way calculation

             

            Tmp:

            noconcatenate

            load *

            resident Table2;

             

            left join(Tmp)

            load *

            resident Table3;

             

            Link:

            left join(Link)

            ID,

            DepartureDate as LinKDepartureDate

            resdient Tmp;

             

            drop table Tmp;

             

            Rename of DepartureDate is necessary to avoid syntetic keys

            OR

            you drop TABLE3 (as there is no further information if there is nothing else in there)

              • Re: Linking Dates issue

                Hi thx for the input,

                 

                I see what you are trying to do with the Tmp table, however when applying the part under Link I will get an extra field in the Link table, LinkDeparture. Basically what Im trying to achieve is that the link table should get the same output with different table setups.

                The picture below shows the content of the Link Table, the right one is how it should be. The left one is with the other table setup.

                 

                I can get the Departure values in it, but not related to the ID numbers..

                Issue comparisson.png

                When I say:

                 

                CONCATENATE (Link)

                LOAD

                ID

                RESIDENT Table2

                 

                It will of course just add 3 lines with the ID numbers, but not related to the DepartureDate..

                 

                 

                 

                 

                (Ive attached the qvws if that is helpful for anyone)