Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
LoKi_asterix
Contributor II
Contributor II

Field not found using Exists()

Why am I encountering a "%KYCIDLookUp2 field not found" error in these lines of script?

LookUp:
LOAD ID as %KYCIDLookUp2,
FROM abc;

Temp:
LOAD ID as %KeyID, 
If(not Exists(KYC_ID,%KYCIDLookUp2) and IsNull(DATE_OF_BIRTH),Dual('Not captured',1),
If(Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  < 20,Dual('Below 20',2),
If(Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  >= 20 and Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  < 30,Dual('20-29',3),
If(Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  >= 30 and Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  < 40,Dual('30-39',4),
If(Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  >= 40 and Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  < 50,Dual('40-49',5),
If(Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  >= 50 and Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  <= 54,Dual('50-54',6),
If(Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  >= 55 and Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  <= 59,Dual('55-59',7),
If(Age(Today(),DATE(FLOOR(DATE_OF_BIRTH),'DD/MM/YYYY'))  >= 60,Dual('60 and Above',8),)))))))) as [Age Bucket]
 
FROM xyz;

 

1 Solution

Accepted Solutions
igoralcantara
Partner - Specialist
Partner - Specialist

In that case is because that field does not exist in the current table, the table where the Exists expression is.

 

You might want to reverse the order of parameters in your Exists clause. The first one is the one that looks for previously loaded values.

Check out my latest posts at datavoyagers.net

View solution in original post

1 Reply
igoralcantara
Partner - Specialist
Partner - Specialist

In that case is because that field does not exist in the current table, the table where the Exists expression is.

 

You might want to reverse the order of parameters in your Exists clause. The first one is the one that looks for previously loaded values.

Check out my latest posts at datavoyagers.net