Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable to get the max(date)

Hi

After loading the data in the Login table to how can I get the Max(LoginDate) and store it in a variable which has to be used while appending the only the new data into the QVD.

Login:

LOAD @1 as LoginDate,

     @2 as User,

     @3 as Product

FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq);

//Help required to create the variable. Which will be used in the below script to append only those data which

//is not there in the above table records

Store * from Login into Login.qvd;

CONCATENATE

LOAD @1 as LoginDate,

     @2 as User,

     @3 as Product

FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq)

WHERE LoginDate > Max(LoginDate) which will come from the variable. I need help for this please.

;

Store * from Login into Login.qvd;


Thanks

Attitude

31 Replies
Not applicable
Author

Hi Sridhar

I have already performed the debugging steps that you have provided. vMax1 gives the exactly the value I am looking for.

Only problem which I have is it is storing all the rows from the text file to the qvd again. This is the problem which needs to be resolved 😞

Below script is still giving trouble. It is not working as expected. Suggest something for the below one. What exactly we need is that it should not load existing data in to the qvd. But the below script loads all the data again in the qvd. 😞

Login:

 

LOAD Date(@1,'DD/MM/YYYY') as LoginDate,

     @2 as User,

     @3 as Product

FROM

(txt, codepage is 1252, no labels, delimiter is ',', msq)

Where Date(@1,'DD/MM/YYYY') > Date($(vMax1),'DD/MM/YYYY');

Thanks

Attitude

Not applicable
Author

Hi Sridhar/Miguel

As requested I have attached sample of my application with the data source. Hope it will be easy for you to understand about issue which I am facing in a better way. Once you come across with the solution please do let me know. It is very very urgent now 😞

Thanks

Attitude