4 Replies Latest reply: Apr 23, 2013 8:25 AM by Wilco de Haan RSS

    Qlikview SQL Load IF date is filled

    Wilco de Haan

      Hi All,

       

      Im having a problem with something and trying to solve it for like 2 days now, without anny solutions.

       

      What i want to create is an extra field which is filled with the date field from table VDO (if they are filled), if not i want to use the dates from Table2 (Or table1 if its easier, because they are equal).

       

      I couldnt solve this problem because i wasn't able to use fields from other tables at once. Like use date-year from Table1 and Per-date1 from VDO at the same time.

       

      I have this (3) tables:

      TABLE1:
      LOAD *,
       ID & '_' & date-year & '_' & [date-month] as Key;
      
      SQL SELECT ID,
        date-year,
        date-month
        Amount-eur,
      FROM Table1;
      
      TABLE2:
      LOAD *,
        yID & '_' & yDateYear & '_' & yDateMonth as Key;
      
      SQL SELECT yID,
        date-year as yDateYear,
        date-month as yDateMonth,
        ID_VDO
      FROM Table2;
      
      
      LOAD *,
        Year([Per-date1]) as VdoYear,
        Month([Per-date1]) as VdoMonth;
      
      SQL SELECT ID_VDO,
        Per-date1,
      FROM VDO;