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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
j_
Contributor
Contributor

Lookup values from file to a db component

Hi guys,

I have a file with 10 values..based on the different parameters i filter out the file to one value..now i have to pass th​e values to a db and create a flag...i dont have common id in file and database..its just based on the values from file i have create a if condition with database rows and create a flag ...

Eg.

My file has values

Row1 A

Row 2 B

row 3 C

Database

row 1 A

Row 2​ B

​Row 3

Now i have to create a condition

If file.row1 equals to db.row1 or file.row2 equals db.row2 then flag equals Y

How to achieve this..

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

Add a sequence id for each row after reading data from file and DB, the expression to generate a sequence id is:

Numeric.sequence("file",1,1)

and for DB is:

Numeric.sequence("DB",1,1)

and then ​do an inner join based on the sequence id on tMap

In the output table, add a new column let's call it flag, set its expression like:

row1.columnName.equals(row2.columnName)?"Y":"N"

 

Hope it helps!

 

Regards

Shong

View solution in original post

2 Replies
Anonymous
Not applicable

Hi

Add a sequence id for each row after reading data from file and DB, the expression to generate a sequence id is:

Numeric.sequence("file",1,1)

and for DB is:

Numeric.sequence("DB",1,1)

and then ​do an inner join based on the sequence id on tMap

In the output table, add a new column let's call it flag, set its expression like:

row1.columnName.equals(row2.columnName)?"Y":"N"

 

Hope it helps!

 

Regards

Shong

j_
Contributor
Contributor
Author

Thank u..this helps 👍👍