Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Where All Previous Records

Hi,

I have a question.

After running a script, I get the following table:

Similarity.PNG

What I want to do, is a WHERE restriction in the script, that won't upload the BLUE highlighted column, since the record of the field STATE_AACL_TO_MATCH it has already been uploaded ('WIELKOPOLSKIE'). So I was thinking on something like:

WHERE STATE_AACL_TO_MATCH  <> Previous(STATE_AACL_TO_MATCH), but that Previous has to consider all the previous values.

Does it exist something like this?

I tested something with Where Not Exists (STATE_AACL_TO_MATCH,STATE_AACL_TO_MATCH) but it didn't work as well...

Thank you very much and best regards to all.

1 Solution

Accepted Solutions
johnca
Specialist
Specialist

Maybe this...

RESULT:

Load

STATE_AACL_TO_MATCH

FirstValue(STATE_OAG) as FIRST_OAG,

FirstValue(SIMILARITY) as FIRST_SIMILARITY

Group By STATE_AACL_TO_MATCH

From DATA

(Or Resident TABLE)

View solution in original post

5 Replies
el_aprendiz111
Specialist
Specialist

Hi,

WHERE STATE_AACL_TO_MATCH  <> Previous(STATE_AACL_TO_MATCH

ORDER BY  STATE_AACL_TO_MATCH

sunny_talwar

How about this

Where Not Exists (STATE_AACL_TO_MATCH)

Anonymous
Not applicable
Author

That seems good. The only thing missing (that I forgot to clarify) is that the STATE_AACL_TO_MATCH that I want to preserve is the one with highest Similarity value.

So in that case I could do like...

WHERE STATE_AACL_TO_MATCH  <> Previous(STATE_AACL_TO_MATCH)

ORDER BY Similarity DESC, STATE_AACL_TO_MATCH;

Something like that I guess.

Thanks!

Anonymous
Not applicable
Author

Sorry, it would be:

ORDER BY STATE_AACL_TO_MATCH, Similarity DESC

johnca
Specialist
Specialist

Maybe this...

RESULT:

Load

STATE_AACL_TO_MATCH

FirstValue(STATE_OAG) as FIRST_OAG,

FirstValue(SIMILARITY) as FIRST_SIMILARITY

Group By STATE_AACL_TO_MATCH

From DATA

(Or Resident TABLE)