3 Replies Latest reply: Dec 5, 2010 10:57 PM by Chakravarthy MS RSS

    join resident files comparing date fields

    Peter Blokker

      I have two files from different origens that I need to unite.

      The first file is on a SQL server and is loaded like this:

      Inquiries:

      LOAD

      idencuesta as "IDInquiry",

      IDINDIC as "CODINDIC",

      autonumber (Indicador & '|' & VAL) as "Cod_Indicador_Val",

      INQUIRYDATE as "InquiryDate",

       

      The other one is on an AS400 database and is loaded like this:

      Objetivos:

      LOAD ID as "id_objetive",

      IDINDIC as "CODINDIC",

      VALIDDATE as "ValidDate",

       

      I need to find the id_objective with the right date in relation to the inquiry date.

      The VALIDDATE has to be smaller or equal to the INQUIRYDATE.

       

      It should be something like this:

       

      load *

      resident DatosEncuestas:;

      inner join

      load

      id_objetivo

      resident Objetivos

      where FechaVigencia = (select max(FechaVigencia) from resident ObjetivosB where FechaVigenciaB <= FechaEncuesta);

       

      This is just an idea that I know doesn't work, but I really have no idea how to handle this in qlikview.

       

      Any ideas?