Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

While loading 2 database will it append or delete?

Hi All,

We have separate database for every year. When I load in to qlikview, will it append the data or will it delete it? Please let me know...

For example:

ODBC CONNECT TO Y0002009; // For the year 2009
ODBC CONNECT TO Y0002010; // For the year 2010

Will this get appended or it will be deleted.

Hope some one can help me out!

If my question is not understandable. Let me know pratically what will happen when we load two or database(which is of same structure) in to qlikview. As in our existing application we are maintaining separate database for every year in our existing application.

Thanks and Regards,

Rikab Kothari

7 Replies
Not applicable

While loading 2 database will it append or delete?

Hi Rikab,

If both databases have the same structure, they will be add in a single table with all the data.

You won't lose any data.

Regards.

Not applicable

While loading 2 database will it append or delete?

Hi Miguel,

Many thanks for your reply. So you mean to say that it will append the data.

For example, If I do something like below one


ODBC CONNECT TO YEAR2008;
bill:
SQL SELECT...

ODBC CONNECT TO YEAR2009;
bill:
CONCATENATE SQL SELECT...


Then bill will contain both the years of data. In short you mean to say that it will append the data and it will not delete.

Please correct me if I am wrong!

MVP
MVP

While loading 2 database will it append or delete?

Hello Rikab,

As databases are not retrieved to QlikView, their structure is not so important. First you will need to load all necessary tables from one database then from the other.

Regardless your tables follow the same schema, you can force concatenate (append) one table to the other, so all results from one year will be added to the other table. So your script, should look like

ODBC CONNECT TO Y0002009;Clients:LOAD *;SQL SELECT * FROM Clients_2009;Invoices:LOAD *;SQL SELECT * FROM Invoices_2009;ODBC CONNECT TO Y0002010;CONCATENATE (Clients) LOAD *;SQL SELECT * FROM Clients_2010;CONCATENATE (Invoices) LOAD *;SQL SELECT * FROM Invoices_2010;


Regards.

Not applicable

While loading 2 database will it append or delete?

You mean to say that it will contain 2 years of data. By the way if I want to do some calculation based on previous year will it be possible.

MVP
MVP

While loading 2 database will it append or delete?

Rikab,

That's exactly what I mean. In the example above, Clients table will have clients from both years, and Invoices will have Invoices from both years, because as you will see in the table viewer, you have just one Clients and Invoices table, instead of two.

Regards.

Not applicable

While loading 2 database will it append or delete?

Hi Miguel A. Baeyens,

When I load two database like below by the default below one will be concatenated with the above as I am using the same table name. Please correct me if I am wrong.

<pre>ODBC CONNECT TO YEAR2008;
bill:
SQL SELECT...

ODBC CONNECT TO YEAR2009;
bill:
SQL SELECT...



MVP
MVP

While loading 2 database will it append or delete?

Rikab,

As I told in my previous post, they will concatenate unless they have different field names or field numbers. To concatenate them anyway, use the CONCATENATE keyword as per my post above.

Regards.

Community Browser