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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dyee4613
Contributor III
Contributor III

Lookup Script

I'm having a lot of trouble with what should be a pretty easy connection.  I'm in the transaction table and I want to lookup an item in the business unit table.  Here is my formula:

Lookup'GLMCU','MCMCU','MCRP21','Business Unit Master') as [AT Class]

Here are the related tables.

[Business Unit Master]:
LOAD
[MCMCU] As [BU Code],

[MCRP21] As [PL Classification]

FROM

[Account Transactions]:
LOAD
[GLMCU] As [BU Code],

Lookup('GLMCU','MCMCU','MCRP21','Business Unit Master') as [AT Class]

FROM

 

As I understand the lookup, I should start with the field I'm looking up (Account Transactions - BU CODE (GLMCU), I want to select the table I'm looking it up at (Business Unit Master - BU CODE (MCMCU), I want to return PL Classification (MCRP21), and I'm referencing the Business Unit Master table.  

What am I doing wrong?

Labels (2)
1 Solution

Accepted Solutions
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @dyee4613 

Why are you using lookup instead of applymap? Based on the usecase (if I understand you correctly) a mapping load with applymap would also work and this would actually be faster in load. 

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

View solution in original post

3 Replies
dyee4613
Contributor III
Contributor III
Author

Edit: If I name both fields BU Code, the data model connects and it works correctly.  However, this doesn't work in any order or naming combination I can think of

Lookup('MCMCU','MCRP21','GLMCU','Business Unit Master') As [AT Class]

I need to use this field as part of a lookup so I need it as part of the script.

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @dyee4613 

Why are you using lookup instead of applymap? Based on the usecase (if I understand you correctly) a mapping load with applymap would also work and this would actually be faster in load. 

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

dyee4613
Contributor III
Contributor III
Author

I finally got it with apply match!  Thank you!