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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LOAD only if value is greater than already existing values

Hi all,

I first load a table like this:

     dataa:

         LOAD id, date from ./my_data.qvd (qvd);

Then, I load a second table like this:

     noconcatenate

     datab:

     sql select id, date from my_table;

Now I want to concatenate the data in table datab to the data in table dataa, but only the lines in datab that have a date value higher than any existing date value in table dataa.

Any tip about how to do this?

Thank you

1 Reply
Nicole-Smith

dataa:

LOAD id, date from ./my_data.qvd (qvd);

maxdatetemp:

LOAD max(date) as maxdate RESIDENT dataa;

LET vMaxDate = PEEK('maxdate',0,'maxdatetemp');

DROP TABLE maxdatetemp;

concatenate (dataa)

sql select id, date from my_table where date > '$(vMaxDate)';