Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

lookup?

any body knows how to explain lookup with small example

dont copy from help doc , i have already seen it

i want how to write in script level can any one give small example with sample data

1 Solution

Accepted Solutions
francoiscave
Partner - Creator III
Partner - Creator III

Hi Commonqlik

See the example by FlipSide here or below :

ProductTable:

Load * inline [
ProductID, ProductCategory, ComponentID
1, A, 123
2, B, 123
3, A, 333
4, C, 541
5, B, 221
]
;

ComponentTable:
Load * inline [
ComponentID,ComponentName
123, ABC
333, DEF
541, GHI
221, JKL
]
;

Data:
Load
Rowno() as ID,
Lookup('ComponentID','ProductID',rowno(),'ProductTable') as ID_output_lkp1,
Lookup('ComponentName','ComponentID',Lookup('ComponentID','ProductID',rowno(),'ProductTable'),'ComponentTable')as ID_output_lkp2
autogenerate 5;

Have fun with QV,

François

View solution in original post

1 Reply
francoiscave
Partner - Creator III
Partner - Creator III

Hi Commonqlik

See the example by FlipSide here or below :

ProductTable:

Load * inline [
ProductID, ProductCategory, ComponentID
1, A, 123
2, B, 123
3, A, 333
4, C, 541
5, B, 221
]
;

ComponentTable:
Load * inline [
ComponentID,ComponentName
123, ABC
333, DEF
541, GHI
221, JKL
]
;

Data:
Load
Rowno() as ID,
Lookup('ComponentID','ProductID',rowno(),'ProductTable') as ID_output_lkp1,
Lookup('ComponentName','ComponentID',Lookup('ComponentID','ProductID',rowno(),'ProductTable'),'ComponentTable')as ID_output_lkp2
autogenerate 5;

Have fun with QV,

François