Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Delta load using flag

Hi,

I want to do delta load for a table, where there is no date field instead there is a flag field.

This table is not insert only, existing records will also get updated (if there is a change in the record, then we will expire the old record with currentflag status ‘N’ and insert new record with currentflag ‘Y’).

Can someone help me with the script to achieve delta load for this table.

Many Thanks,

Swathi

Tags (4)
8 Replies
Not applicable

Re: Delta load using flag

Hi, swathi.

Please provide sample data to better understand.

Not applicable

Re: Delta load using flag

Hi Alex,

I'm sorry i do not have any sample data for this requirement, intead i collected few information as below;

1. This table holds Employee details.

2. A dimension table which holds millions of records

3. Insert and Update table eg., New employee added will be insert, and salary, promotion details will be updated. No delete of records from employee table.

4. Doesnt have any of the date field to proceed with the delta logic.

5. Instead there is a "CurrentFlag", on top of this field delta logic is to be applied.

6. Current Flag - Holds only two data in this column which Y and N.

5. if there is a change in the record, then will expire the old record with currentflag status ‘N’ and insert new record with currentflag ‘Y’.

Many Thanks,

Swathi

Not applicable

Re: Delta load using flag

Do you have key field in this table?

Not applicable

Re: Delta load using flag

Do you can read QlikView help file?

Pleas try search "Using QVD Files for Incremental Load".

Case 3 is your case and i think it is better implementation.

Not applicable

Re: Delta load using flag

yes i have a key field in this table.

But no date field.

Not applicable

Re: Delta load using flag

Try use this:

QV_Table:

LOAD

     PrimaryKey,

     X,

     Y;

SQL

SELECT

     PrimaryKey,

     X,

     Y

FROM DB_TABLE

WHERE flag= 'Y'; //Load only modified data from db

Concatenate LOAD PrimaryKey, X, Y FROM File.QVD

WHERE NOT Exists(PrimaryKey); //Add all unmodified data from QDV

STORE QV_Table INTO File.QVD; //store back updated data into qvd

Not applicable

Re: Delta load using flag

Thanks Alex,

I shall try this approach.

Not applicable

Re: Delta load using flag

You are welcome.