Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to load data from 2 sources to one table

Hi,

Does anyone know how to load data from 2 different sources into a table?

Says - I can use QV to load data from SQL db and at the same time i want to use file load? both to the same table.

4 Replies
Miguel_Angel_Baeyens

Hello Nick,

It is possible, indeed. You can create a table kind of

Table:LOAD Field1 Field2;SQL SELECT Field2, Field2 FROM SourceSQLTable;CONCATENATE LOAD Field1 Field2 FROM File;


CONCATENATE keyword is needed when field names are not the same, otherwise there's no need to declare it as Qlikview concatenates implicitly when fields are named alike.

Not applicable
Author

Hi Miguel,

When you say that QlikView concatenates implicitly when fields are name alike ... do you mean Join?

QlikView won't combine the data from two columns into a single table just becase they are name the same ... will it?

If it does ... that may explain the problems that I am having.

Thanks

Lee

Miguel_Angel_Baeyens

Hello Lee,

You can force joining two tables, left, right joins, etc. Concatenating tables means that after loading all information from one table, if next table shares the same structure of fieldnames, qlikview will store all values into the first (the only at the time) named table.

Check the following (untested, but pretty sure it will do) to make and idea

ImplicitlyConcatenatedTable:LOAD * INLINE [Name, LetterJohn, JMike, MAstrid, ABarb, B];LOAD * INLINE [Name, LetterPeter, PMaxwell, MDana, D];


After loading, you will only have one table, with values from both loads. Now, change the inline source from wherever the source you need to be.

EDIT: Really useful when you need to run a folder loading files, make some kind of change to table names and loading them all (fiscal years with year number in the table name, etc.

Regards!

Not applicable
Author

Miguel,

You are spot on ... and if you have a different column structure on the 2nd table ... e.g. Number as a 3rd column then it will create a synth key so you can then use concatenate to tidy that up ...

Got it ... great example to use though.

Thanks for your help.

Lee