Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
with out date field incremental load with id how can i do? plz help
Assuming your id is increasing ascending, you could use something like the following (syntax isn't correct, you'll have to use your own fields and your library reference in the from):
//Load Sales QVD to get the latest Order date
"Sales":
LOAD Order_ID,
...
Product
FROM
Sales.qvd
(qvd);
"Sort_Sales":
NoConcatenate LOAD
*
Resident Sales
ORDER By Order_ID ASC;
DROP Table Sales;
//Using -1 for the Row because it is the last record
//Parameters: Peek(FieldName, Record, Table);
Let vLastID = Num(Peek('Order_ID', -1, 'Sort_Sales'));
DROP Table Sort_Sales;
This will give you the latest Order_ID in the variable vLastID.
Now load the records from your source that are higher than vLastID (your increments).
Concatenate your Sales.qvd with that.
Save the new Table as Sales.qvd.
save the maximum ID in QVD
then on the next reload get the max ID and select from database where ID>max ID
then save new max ID in QVD
Assuming your id is increasing ascending, you could use something like the following (syntax isn't correct, you'll have to use your own fields and your library reference in the from):
//Load Sales QVD to get the latest Order date
"Sales":
LOAD Order_ID,
...
Product
FROM
Sales.qvd
(qvd);
"Sort_Sales":
NoConcatenate LOAD
*
Resident Sales
ORDER By Order_ID ASC;
DROP Table Sales;
//Using -1 for the Row because it is the last record
//Parameters: Peek(FieldName, Record, Table);
Let vLastID = Num(Peek('Order_ID', -1, 'Sort_Sales'));
DROP Table Sort_Sales;
This will give you the latest Order_ID in the variable vLastID.
Now load the records from your source that are higher than vLastID (your increments).
Concatenate your Sales.qvd with that.
Save the new Table as Sales.qvd.
Thaks, but i need update also
how do you know if a record was updated in your data source?
I need to insert And Update with incremental load but there is no date field i have use only ID plzzzzz Help Me
I don't know about that but i have to do incremental load
Please refer to the below Link..
http://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/
What Ali means is - how do you know the record was updated?
With no "date updated" field how (in pseudo code / English terms) do you know the field has been updated?
If you can't explain that or there is no logic other than the fields gets updated then implementing incremental load is probably not a solution for your problem.
Unless of course you know which ID's were updated (via an Audit table or something similar) in which case you'll:
Load the records from your saved QVD, excluding those ID's.
Add the following:
Load those ID's from source and concatenate them as above to the QVD before saving the new one.
Maybe
QV_Table:
SQL SELECT PrimaryKey, X, Y FROM DB_TABLE
WHERE ModificationTime >= #$(LastExecTime)#;
Concatenate LOAD PrimaryKey, X, Y FROM File.QVD
WHERE NOT Exists(PrimaryKey);
STORE QV_Table INTO File.QVD;