Discussion Board for collaboration on QlikView Scripting.
I have a question. I have 2 databases with 3 important tables. The tables in the different databases have the same fields. Example:
Database 1: Table GRBK Fields: Number,Year,Period,Amount
Database 2 Table GRBK Fields: Number,Year,Period,Amount
It is possible that both databases have the same data :
Database 1: Table GRBK 2000,2010,9,100
Database 2: Table GRBK 2000,2010,9,100
In Qlikview i need both records. Anybody knows how to combine both records ?
Go to Solution.
Hello Francis and welcome to the Forums,
Do something like the following:
LOAD *; SQL SELECT * FROM Database1; CONCATENATE LOAD *; SQL SELECT * FROM Database2;
Concatenate keyword is not needed when both tables have the same number of fields and fields are named alike. Anyway, I set it here should you have some differences between both tables.
Hope that helps
You could do something along these lines:
DATATABLE:SQL SELECT Number, Year, Period, Amount, 'Database1' AS SourceFROM Database1.GRBK;CONCATENATESQL SELECT Number, Year, Period, Amount, 'Database2' AS SourceFROM Database2.GRBK;
Try something like the following
Orders_no,Order_date,Number,Year,Amount,Period,'DB1' as MyDatabase,etcFrom db1.scheme.orders_table;
Orders_no,Order_date,Number,Year,Amount,Period,'DB2' as MyDatabase,etcFrom db2.scheme.orders_table;
Thanx to all. Jonathan i use your script. And of course it works.
Must i close this question on this forum?
I'd recommed you to do that, so any other user looking for something similar will find the question as solved.