Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

incremental load with where clause

hey!!

i am trying to implement incremental load i am having trouble using the where clause.

i have a primary key as ID and i want to enter more data but i want to exclude entering the same ID twice.

can anyone tell me how to use where clause?

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Actually what heppening is,

First Load will create a qvd of your table data.

After that in the second Load, the incremented data only will apend to the last created qvd.

Now we are again creating the qvd with the same name for the total data.It will override the existing qvd.

The same process will repeats in every reload.

For your question, You are loading the qvd only.So, not a problem and without reload you can't achieve it.

Hope it helps you..

View solution in original post

6 Replies
SunilChauhan
Champion II
Champion II

where ID>max(ID)

or

where Exists(ID)

or

Create Var

let vMax=Max(ID);

then in where Clause ID>$(vMax)

hope this helps

Sunil Chauhan
Not applicable
Author

Hi,

Use this script

 

 

//Main:
//LOAD * Inline [
//EmpID, EmpName, Sal
//1, A, 10000
//2, B, 20000
//3, C, 15000
//4, D, 18000
//5, E, 30000
//6, F, 25000
//];

//STORE Main into Main.qvd;


Main:
LOAD EmpID
FROM

(
qvd);

Let vMaxID = Peek('EmpID',-1,Main);

Drop Table Main;

Main:
LOAD EmpID,
EmpName,
Sal
FROM

(
qvd);
Concatenate
LOAD EmpID,
EmpName,
Sal
FROM

(
txt, codepage is 1252, embedded labels, delimiter is ',', msq)
Where EmpID>$(vMaxID);

STORE Main into Main.qvd;

Not applicable
Author

thank you Ravi Kumar

the script you suggested is giving me the required result but the thing is as the fields are same , qlikview is automatically concatenating both the tables. i wanted that when we store the result in main.qvd after that why do we have to reload it i just need to add more data to it. can we not just load the second file and store it in main.qvd??

is it posible??

fkeuroglian
Partner - Master
Partner - Master

Hi

//LOAD * Inline [
EmpID, EmpName, Sal
1, A, 10000
2, B, 20000
3, C, 15000
4, D, 18000
5, E, 30000
6, F, 25000
];

Concatenate
LOAD EmpID,
EmpName,
Sal
FROM

where not exist(ID)

//STORE Main into Main.qvd;

GOOD LUCK

Fernando

Not applicable
Author

And also it should show the number of items added to the previous file.

Not applicable
Author

Hi,

Actually what heppening is,

First Load will create a qvd of your table data.

After that in the second Load, the incremented data only will apend to the last created qvd.

Now we are again creating the qvd with the same name for the total data.It will override the existing qvd.

The same process will repeats in every reload.

For your question, You are loading the qvd only.So, not a problem and without reload you can't achieve it.

Hope it helps you..