How to do it…

  1. Create a new Qlik Sense application.
  2. Open the Data load editor.
  1. Load the following script:
For each File in filelist ('C:QlikSense*.xlsx')  

ProdSales: 
LOAD 
 left(FileBaseName(),18) AS ProdSalesFileName, 
filename() as FileName, 
 [Product], 
[Sales] 
FROM [$(File)] 
(ooxml, embedded labels, table is Sheet1) 
WHERE Sales >250000; 

Execute cmd.exe /C move "$(File)" "C:QlikSenseProcessed"; 

next File  
SET rowCount = 0; 
LET rowCount = NoOfRows('ProdSales'); 

IF rowCount > 0 AND 
Alt(FileSize('C:QlikSenseQVDProdSales.QVD'),0) > 0 THEN
Concatenate(ProdSales) LOAD * FROM C:\QlikSenseQVDProdSales.QVD (qvd);
STORE ProdSales INTO C:QlikSenseQVDProdSales.QVD; ELSE STORE ProdSales INTO C:QlikSenseQVDProdSales.QVD; END IF DROP TABLE ProdSales; LOAD * FROM C:QlikSenseQVDProdSales.QVD (qvd);
  1. Now, add the remaining three Excel files, that is, February.xlsx, March.xlsx, and April.xlsx, to the source location; in the case of this recipe, it is c:QlikSense.
  1. Load the script again. You will notice that all the files have been processed and moved to the processed folder. At the same time, the new data is appended to the ProdSales.QVD file.
  2. In order to test the data loaded into the QVD, go to App overview and create a new sheet.
  3. Drag a Table object on to the sheet.
  4. Add ProdSalesFileName as the first dimension and label it Month.
  5. Add Product as the second dimension.
  6. Add the following expression and label it as Sales:
Sum(Sales) 
  1. The resultant table would look like the following, with each month showing records only with sales > 250,000:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset