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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
JoeCharter
Partner - Contributor
Partner - Contributor

Load if distinct???? Combining Data Files, but not loading duplicates

I have 2 data files that contain the same fields.  One file is from last year and the other file is from this year.  

The files keep track of estimate information and each entry is timestamped with "Modified Date".  If an estimate was only edited last year then it won't be in this year's file.  If the estimate was only edited this year then it won't be in last year's file.  But there are many instances where the estimate spanned both years and is included in both files.  I only want to load the data with the most recent Modified Date.

The other challenge is that each estimate loads multiple rows of data.  They all have the same Estimate ID, but show different details about the estimate.  I only want to keep the most current rows for each estimate.

Does something like the bold text below exist?

Table 1:

LOAD Estimate ID, Estimate Name, Modified Date, ....other estimate info... FROM [lib://.......this year]

Table 2:

LOAD (if Estimate ID is not already in Table 1) Estimate ID, Estimate Name, Modified Date, ....other estimate info... FROM [lib://.......last year]

Any suggestions would be greatly appreciated.

 

Labels (2)
1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Joe,

Yes, you can use the Exists() function:

LOAD

...

WHERE

    NOT Exists([Estimate ID])

;

Cheers,

 

Ask me about Qlik Sense Expert Class!

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Joe,

Yes, you can use the Exists() function:

LOAD

...

WHERE

    NOT Exists([Estimate ID])

;

Cheers,

 

Ask me about Qlik Sense Expert Class!
JoeCharter
Partner - Contributor
Partner - Contributor
Author

That worked great!  Thanks for the tip.