6 Replies Latest reply: Aug 29, 2016 6:54 PM by Joey Lutes RSS

    Append Data to Resident Table

    Joey Lutes

      I'm loading data from 24 spreadsheets.  The format is identical.

      I have a successful load going for 1, but am trying to add #2.  I wish to append data to the existing resident Qlik Sense tables.

       

      Specifically, this data is being loaded through a crosstable.  I think the long-term solution to this is a For . . While loop (which I'm not 100% sure how to do, but will tackle that in a bit) but for now, I'm just copying the load statements to see if it will successfully load 2 of them.

       

      Here's what code looks like today (that's not working).  It successfully loads the first file, but the 2nd doesn't seem to appear.

      Thoughts??

       

       

      Forecasttemp:

      Crosstable (ForecastDate, ForecastUtilization, 2)

      Load *

      FROM [lib://source/newfile1.xlsx]

      (ooxml, embedded labels, table is [Forecast]);

       

       

      ForecastData:

      noconcatenate

        Load

        AutoNumber(Port) as PortKey,

              Date(Date#([Report Date], 'M/D/YYYY')) as ForecastReportDate,

              ForecastUtilization,

              Date(Num#(ForecastDate, 'M/D/YYYY')) as ForecastDate

      Resident Forecasttemp;

      drop table Forecasttemp;

       

       

      Forecasttemp2:

      Crosstable (ForecastDate, ForecastUtilization, 2)

      Load *

      FROM [lib://source/newfile2.xlsx]

      (ooxml, embedded labels, table is [Forecast]);

       

       

      ForecastData:

        Concatenate //(have tried with and without this)

          Load

        AutoNumber(Port) as PortKey,

              Date(Date#([Report Date], 'M/D/YYYY')) as ForecastReportDate,

              ForecastUtilization,

              Date(Num#(ForecastDate, 'M/D/YYYY')) as ForecastDate

      Resident Forecasttemp2;

      drop table Forecasttemp2;