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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use field from another table in the script. Should i use Lookup() ?

Hi everybody.

I have a table (table 1) connected to another table (table2) by a key.

I have to add new fields to the table 1 with an excel and i have to do calculations with if and that sort of things (in the table 1). But i have one field (Concept) in the table 2 and i have to use it in the calculations from the table 1.

I don't wanna join the tables, should i use lookup? I tried to use this function but it didn't work.

Thank you

3 Replies
PrashantSangle

Hi,

If you want to do this in script then you have to use join and bring all the fields in one table.

If not then try it in front end.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
simenkg
Specialist
Specialist

You can use ApplyMap.

//First load your second table:

Table2:
Load * from Table2.xls (...);

//Create a mapping table with the field you need.

mapConcept:

mapping load %KeyField, Concept resident Table2;

//Load Table1

Table1:
Load *,

      if(ApplyMap('mapConcept',%KeyField,null()) = 'Your condition', ....)

     from Table1.xls (...)

Colin-Albert
Partner - Champion
Partner - Champion

Applymap is a safer option than using a join, as applymap will only return a single value (or null) unlike a join which may cause the number of rows in your data to increase if two values match the join criteria.

There are more details here

http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap