Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

get the maximum id and use it in a where condition

Hello

I have a table in SQL server that has an identity column

I loaded its data and stored it in a qvd file

now I want to get the maximum identity value then save it in a variable and then use this variable in the where condition of a new reload to get new records to concatenate them with the qvd file

please help

I can walk on water when it freezes
3 Replies
Not applicable

Ali,

The Community Corner is for QlikCommunity-related questions.  Please post in the Development or New to QlikView communities with questions about the product.  I've moved this thread to Development.

ToniKautto
Employee
Employee

I sounds like you are looking for just adding new records in your QVD file. If this is true, then you probabaly should do an incremental load and QlikView will add the new records.

Please see section "Using QVD files for incremental load" in the QlikView Reference manual.

http://download.qlik.com

Not applicable

Hi

I do not know if incremental load will solve it for you. I had a similar problem that I solved like this:

tTrain_Tmp:

Load *

From [tTrain_Tmp*.qvd] (qvd);

// Get latest date from read QVD files

tMaxDate_Tmp:

Load

     Max(Date(LeaveDate)) as MaxLeaveDate

Resident tTrain_Tmp;

Let vTrainDate = Peek('MaxLeaveDate', 0);

Drop Table tMaxDate_Tmp;

// Get the next day

Let vTrainDate = '$(vTrainDate)' + '1';


The vTrainDate variable is used to control where to start next load of data.

It may not be very efficent to parse the table like this, but it works.