Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load/Add data from different data source

Hi all,

I have a question about data loading from excel.

I have built a data model, with a series of associations and its dashboard, based on an excel file (excel 1).
Now I need to re-load the data from a different excel (excel 2). Excel 1 and excel 2 have the same structure in terms of sheets and columns; the only things that change are the excel name and local folder (sheets names and columns names are the same).

When I click on "add data" from the data manager and I add excel 2 content, it basically duplicates the tables in Qlik, so I need to cancel the old ones and re-do the associations with the new ones.

Is there a smarter way to update the data? 🙂

Thanks

Alia

3 Replies
DavidŠtorek
Creator III
Creator III

Hi,

this is the case when it is better to use data load editor instead of data manager. If content is really the same and just name and folder is different than I would recomend you to use for...next, for...each statement or even a subroutine.

It depend on logic behind file naming and placing in folders (e.g. name of file is month and folders are years or folders are divisions and files are teams...)

For Each sheet in 'Září','Říjen'

Table1:
Load
...<your data>...
FROM [lib://Vykazy/Copy of Vyhodnocení výkazů L.xlsx]
(ooxml, embedded labels, header is 1 lines, table is $(sheet))
where not IsNull("Písmeno řádky");

Next sheet

Above is example of loading more sheets from one file. But you can use it allso for folder and file name. You can even use two cycles at once

for each Folder in '<some values>'

      for each File in '<some values>'

         LOAD 
          ...<your data>...
        FROM [lib://.../$(Folder)/$(File).xlsx]
(ooxml, embedded labels, header is 1 lines, table is Sheet1)
next File
next Folder

Hope thelps

Anonymous
Not applicable
Author

Hi David, thanks for the answer. I haven't used scripts yet on Qlik, so I'm not an expert. I'll study a bit and let you know!

timpoismans
Specialist
Specialist

When both files are exactly the same, only location and name of the file is different, you basically just need to add a new connection in the Data Load Editor and change the FROM statements.

The actual load statements will continue to work with both files containing the exact same data.

 

Regards,

Tim P.