Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JJ141
Contributor II
Contributor II

Linking table made through query and an excel file through Qlik Script

Hey Guys,

I was just wondering how to import excel files in Qlik Sense through the script. I've also generated a table using SQL query connected to our database and I was curious if it is possible to link that table and the new imported excel file?

Some demo script would be very useful

Thanks

Labels (2)
2 Replies
dplr-rn
Partner - Master III
Partner - Master III

if you are using the script editor. the associations are automatically formed between columns with same name.

So if you DB table has ID and excel also has ID it will automatically be linked together.

Rodj
Luminary Alumni
Luminary Alumni

To load data from an excel file using the script editor (i.e. not dragging and dropping it on to the data manager or adding it via the data manager) you need to:

  1. locate or create a data connection to a directory in which your excel file resides (note that relevant security rules will restrict what you can access)
  2. With the aforementioned data connection click on "select data" to locate your excel file
  3. Using the presented dialog to select options such as header rows etc
  4. click on load data.

General help on this process is available online here.

Linking the data to a table isn't just possible, it's what Qlik does better than any other tool available via the associative model. I highly recommend googling terms such as "the Qlik associative difference" and reading the white papers etc you find.

To link the two data sets it is as @dplr-rn  has described, you simply need a column in each dataset that is the same name. You can easily rename a column either via the process of adding or by renaming the column in the script directly:

Load

Col1 as [My Col Name],

Col2

From......blah;

There's lots of example script in the online help and in the various downloadable demos and other solution examples here on community.

Hope that sets you on the right path.