Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor II

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? 🙂



3 Replies
Contributor III

Re: Load/Add data from different data source


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'

...<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>'

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

Hope thelps

New Contributor II

Re: Load/Add data from different data source

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!

Valued Contributor

Re: Load/Add data from different data source

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.



Tim P.