Discussion Board for collaboration on QlikView Scripting.
how can i do a multiple lookup?
I tried following without luck :
Lookup ('ComponentName', 'ProductID', Lookup ('ProductCategory', 'ProductID', ProductID, 'ProductTable') , 'ComponentTable')
Can you show script and sample data.
cant show sample data, script is just loading three tables and making an lookup at one of this tables (Product).
With the result of this lookup i want to lookup at the second table (Component).
Additionaly when doing a simple lookup i will get erverytime only one result.
But there are also use cases where more than one value can be looked up, how to achive this?
try applymap function, experts please correct me if I am wrong.
this is not really helping me, i need just an lookup where the third parameter is an result of an previous lookup.
Your example doesn't look correct. Your inner lookup retrieves ProductCategory based on ProductID and the same is used against ProductID in outer lookup?
Yes it should be like this,
Lookup ('ComponentName', 'ComponentID', Lookup ('ComponentID', 'ProductID', ProductID, 'ProductTable'), 'ComponentTable')
but that still not change the fact that it seems that nested lookups are not possible in qlikview
I don't think that is the case, the example below seems to work.
Load * inline [ProductID, ProductCategory, ComponentID1, A, 1232, B, 1233, A, 3334, C, 5415, B, 221];ComponentTable:Load * inline [ComponentID,ComponentName123, ABC333, DEF541, GHI221, 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_lkp2autogenerate 5;
I am sure there is a better way of doing what you want unless you can give more info to suggest otherwise. ApplyMap or left joins should do what you need.