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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Search one column and replace another column with value if matched

I'm trying to do a search on one column, and if the field matches a pattern or value, then a different column in the row gets a value. 

What is the proper way to do this?

 

Labels (2)
8 Replies
vapukov
Master II
Master II

check tReplaceList make 2 inputs from the same file 

Anonymous
Not applicable
Author

This seems like a brutal workaround, why doesn't replace offer separate lookup/replace columns?

I'm also completely unsure how you propose I use treplacelist, what do you mean two inputs?   

vapukov
Master II
Master II

there are many ways could help to achieve the same result, you task - check and choose the best for you (especially when you did not share all information 😉 )

 

but all of them as described require self-join - multiple use the same table as different source and join them

it could be tMap with main flow and 1-* lookup inputs, it could be tReplaceList, in all cases - as you describe you want to search not in the same row, but in all rows from a different column, so you will need for each row from main flow make a lookup for all rows from lookup columns

Anonymous
Not applicable
Author

Woah,  not all rows, the other column is known beforehand and will be in the same row.

Anonymous
Not applicable
Author

Don't need to search all rows, the other column is known beforehand and will be checking a field in the same row.

 

 

Anonymous
Not applicable
Author

Given example:

column_1, column_2, column_3
AAA, BBB, CCC
AAA. BBB, CCC
AAB, BBB, CCC

So for each row, if column_1 = "AAA", then column_3 = "DDD", The expected output would be:

column_1, column_2, column_3
AAA, BBB, DDD
AAA. BBB, DDD
AAB, BBB, CCC
vapukov
Master II
Master II

Hi,

 

if all in same row, it is simple:

in tMap in col3 put

col1.equals("AAA")?"DDD":col3
Anonymous
Not applicable
Author

Not a bad option, I've used one just like that prior, but is there any way to handle a large amount of them?