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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Adding a new field

Hi there - hopefully this should be a quick one to answer...

I have a set of 10 databases (one for each customer site) with identical structures that need to be pulled together into a single app.

I have managed to consolidate all the tables I need into a single table using concatenation - but I now need to be able to identify which of the ten sources the data came from. For example, is this employee from location x or y?

What do I need to add to my script to specify the location as a dimension that can be used for analysis?

Many thanks

Rob



1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

When you are loading the QVD files, just add the field there.

LOAD *, 'Customer1' as Customer from QVD1;

CONCATENATE LOAD *, 'Customer2' as Customer from QVD2;

.... and so on.

or you can even use LOAD *, filename() as Datasource .... then it will load the QVD file name itself as source. Just in case if you are keeping the customer name/number in the data file name.

View solution in original post

3 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

When you are loading the QVD files, just add the field there.

LOAD *, 'Customer1' as Customer from QVD1;

CONCATENATE LOAD *, 'Customer2' as Customer from QVD2;

.... and so on.

or you can even use LOAD *, filename() as Datasource .... then it will load the QVD file name itself as source. Just in case if you are keeping the customer name/number in the data file name.

Not applicable
Author

I presume you have done something like this in your script, I have also added the new field.

Table:

Load *,

'Database1' as Source

from Database1.sometable

concatenate (Table)

Load * ,

'Database2' as Source

from Database2.sometable

concatenate (Table)

Load * ,

'Database3' as Source

from Database3.sometable

hope this is of help,

Regards,

Neil

Not applicable
Author

Perfect - thanks guys, that is nice and easy!