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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Insert only if the row doesn't Exists

Hi,
How can I make it possible to Insert a row only if it doesn't Exists in the table?
I'm using "Update or Insert" on tMySQLOutput component. But that doesn't work for me!
Labels (2)
23 Replies
Anonymous
Not applicable
Author

key_strings is the output component having row12.keywords. it has a value.
janhess
Creator II
Creator II

OK so your output is all the records that don't match the lookup.
Anonymous
Not applicable
Author

it's fixed. I had to use the Global Variable.
janhess
Creator II
Creator II

what Global Variable? You never mentioned it.
_AnonymousUser
Specialist III
Specialist III

Set it to insert. Press the button repeatedly will be rejected.
Anonymous
Not applicable
Author

@janhess > I meant the GlobalKey Map variable.
By the way: i'm having the same thing as @infoleather mentioned. rows are rejected when I run the job for second or third time. But for the first time, it is inserting everything... that means duplication is still there!
janhess
Creator II
Creator II

Sorry, don't understand what you're doing.
Anonymous
Not applicable
Author

this is strange, i've provided all the details above.
Well.. I've just taken some screenshots of the entire job workflow including the queries and the mysql results. hope that helps in understanding!
janhess
Creator II
Creator II

Don't understand the query in image 3. What are the globalMap.Get items?
The table you are looking for duplicates in is keyed on an id so you would need to look for duplicate data items.
Anonymous
Not applicable
Author

globalMap.Get items are setup in tMap so can be used in the Query, to find the exact match.
don't get what you mean?
"The table you are looking for duplicates in is keyed on an id so you would need to look for duplicate data items."
please be descriptive!