2 Replies Latest reply: Aug 19, 2011 2:23 AM by Aadil M RSS

    Trying to load missing data

      Hi,

      I am new to QlikView and I'm trying to create a QlikView document to store and manage data. I have several reports produced by the same program, but out of a list of about 30 fields the various reports may contain any 20 of these.

       

      The code I am using is:

       

      PolicyData:
      LOAD '$(varRunDate)' as RunDate,
        '$(varCompany)' as Company,
        '$(varProduct)' as Product,
        CALENDAR_YR,
        GROSS_PROFIT,
        NET_PROFIT
        FROM
      $(varFilePath).prn
      ;

       

      Store PolicyData into [C:\QlikView Data\PolicyData_$(varRunDate)_$(varCompany)_$(varProduct).qvd];

       

      PolicyData:
      LOAD * FROM
      [C:\QlikView Data\PolicyData_*.qvd]
      (qvd);

       

      So I load in the new report, save it in a data folder, then load in all saved reports. As I load in all saved reports after every update I want all the data to be saved with identical columns, but some reports will contain GROSS_PROFIT and not NET_PROFIT, and vice versa. In reality there are more like 30 fields of which the report may contain any 20.

       

      When I first load in the report is there any way to give a field a default value of 0 if it is not present in the report?

       

      Thanks in advance for any help.