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: 
solomonadjei
Contributor III
Contributor III

***Apply Map***

Afternoon Experts,

Could anyone help me understand why I do get "Field not found error / Field 'STP' not found " from below script.

Thanks.

stp1.PNG

 

 

 

 

4 Solutions

Accepted Solutions
sunny_talwar

Try this

ApplyMap('Table', [TRUST CODE]) as STP

View solution in original post

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You're only loading the fields [TRUST CODE] and [TRUST NAME] from the TRUSTS.xls file. You don't load an STP field from the source file so you can't use STP in that load statement as a source field.


talk is cheap, supply exceeds demand

View solution in original post

punitpopli
Specialist
Specialist

Apply Map will work when you have the filed already in the table you are referring, as your STP filed is not available in the load statement its giving error.

either follow the solution what Sunny had suggested or try below : 

 

Load *,

ApplyMap('Table', STP) as STP;

Load 

[TRUST CODE]

[TRUST NAME] as STP

from table name;

 

 

View solution in original post

pradosh_thakur
Master II
Master II

Assuming that you want to compare [Trust Name] in both tables and want to populate [stp] for the same you need to use applymap('Table',[TRUST NAME]) AS [stp]

again the mapping table columns need to be in a key -value order. so what ever is the key( the column you need to compare) should be in the first place
so
mapping load
[Trust Name],
[STP]

from ......

Learning never stops.

View solution in original post

11 Replies
sunny_talwar

Try this

ApplyMap('Table', [TRUST CODE]) as STP
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You're only loading the fields [TRUST CODE] and [TRUST NAME] from the TRUSTS.xls file. You don't load an STP field from the source file so you can't use STP in that load statement as a source field.


talk is cheap, supply exceeds demand
punitpopli
Specialist
Specialist

Apply Map will work when you have the filed already in the table you are referring, as your STP filed is not available in the load statement its giving error.

either follow the solution what Sunny had suggested or try below : 

 

Load *,

ApplyMap('Table', STP) as STP;

Load 

[TRUST CODE]

[TRUST NAME] as STP

from table name;

 

 

pradosh_thakur
Master II
Master II

Assuming that you want to compare [Trust Name] in both tables and want to populate [stp] for the same you need to use applymap('Table',[TRUST NAME]) AS [stp]

again the mapping table columns need to be in a key -value order. so what ever is the key( the column you need to compare) should be in the first place
so
mapping load
[Trust Name],
[STP]

from ......

Learning never stops.
solomonadjei
Contributor III
Contributor III
Author

Thanks Gysbert,

Really appreciate your respond. how would you write the script as i have tried all the suggestion and still not working.
solomonadjei
Contributor III
Contributor III
Author

Thanks pradosh_thakur ,
Am still struggling to excecute the script. still not doing what I want.
solomonadjei
Contributor III
Contributor III
Author

Many thanks for promt respond. Am still struggling to get it working.
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

ApplyMap('Table', [TRUST CODE], 'No value found') as STP

talk is cheap, supply exceeds demand
pradosh_thakur
Master II
Master II

copy paste the part of the code where u are using applymap. If our solution doesn't work. It will be easier to help you out
Learning never stops.