Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
markf1995
Partner - Contributor II
Partner - Contributor II

Add column to SQL load

I am new to qlikview. I am trying to add a column to all records I am loading that identifies the source data wharehouse. In a CSV load I would just right at the end of the colmns - 'Table xxx' as SOURCE - and I would be able to query SOURCE in my visualizations. I can load the data correctly but I don't know how to add this extra column to each record.

OLEDB CONNECT TO [Source ID Properties (all this stuff works)] (XPassword is (all this stuff works));


SQL

SELECT
"Dimension_1",
"Dimension_2",
"Dimension_3",FROM "Data Source"

where Dimension_3 = 20120101;

How do I add a column 'Table xxx' as SOURCE to this data pull that is working ok. Where 'Table xxx' is a field I want to define in the load script.

Thanks!

1 Solution

Accepted Solutions
Not applicable

Hello,

I guess in the case of a simple sql query, such changes can be added directly in the statement.

But usually a preceding load in QV will help you in any needed data transformation, for example:

Table1:

Load field1,

field2,

field1 & ' | ' & field2 as keyfield,

'custom data' as customfield;

SQL SELECT field1, field2 FROM database;

Whenever you connect to your sql db to extract the tables, in the "script" tab, check the "Preceding Load" option so the "load" part comes automatically.

Hope this helps.

View solution in original post

2 Replies
Not applicable

Hello,

I guess in the case of a simple sql query, such changes can be added directly in the statement.

But usually a preceding load in QV will help you in any needed data transformation, for example:

Table1:

Load field1,

field2,

field1 & ' | ' & field2 as keyfield,

'custom data' as customfield;

SQL SELECT field1, field2 FROM database;

Whenever you connect to your sql db to extract the tables, in the "script" tab, check the "Preceding Load" option so the "load" part comes automatically.

Hope this helps.

markf1995
Partner - Contributor II
Partner - Contributor II
Author

You were right I did not clearly understand the role of the preceding load. I researched your answer a bit more and found this link helpful

http://qlikviewnotes.blogspot.com/2009/12/simplify-with-preceeding-load.html

Thanks JP for your quick help!!!