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: 
SCM
Contributor
Contributor

UNLOAD WHEN INSERT COLUMN NEW FUNCTION

LOCATION_IN:
Mapping Load
SLoc,
Description&'|'&PLANT
FROM [lib://STOCK DEC/location inter.xlsx]
(ooxml, embedded labels, table is location);

 

LOCATION_EX_RISK:
Mapping LOAD
"Vendor No",
"Vendor Name 1"
FROM [lib://STOCK DEC/location ex.xlsx]
(ooxml, embedded labels, table is Sheet1);

LOAD

"Storage Location",

Vendor,

SubField(ApplyMap('LOCATION_IN',"Storage Location",Null()),'|',2) as [IN],


ApplyMap('LOCATION_EX_RISK',"Vendor",Null()) as [OUT]

UNTIL OVER HERE THE LOAD OK BUT WHEN I INSERT THE BELOW FUNCTION IT IS UNABLE TO LOAD


[IN]&''&[OUT] as [LOCATION]

The following error occurred:
Field 'IN' not found
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

The field [IN] is an output field and can't be used as an input field in the same LOAD. You can replace [IN] at this point with the same expression used to create [IN], use a preceding load with [IN], or perform a resident load of the table to use [IN].

You will have the same problem with [OUT].

Preceding load pattern:

LOAD *,
	[IN] & ' ' & [OUT] as LOCATION
;
LOAD
	"Storage Location",
	Vendor,
	SubField(ApplyMap('LOCATION_IN',"Storage Location",Null()),'|',2) as [IN],
	ApplyMap('LOCATION_EX_RISK',"Vendor",Null()) as [OUT]
	...
FROM ...

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The field [IN] is an output field and can't be used as an input field in the same LOAD. You can replace [IN] at this point with the same expression used to create [IN], use a preceding load with [IN], or perform a resident load of the table to use [IN].

You will have the same problem with [OUT].

Preceding load pattern:

LOAD *,
	[IN] & ' ' & [OUT] as LOCATION
;
LOAD
	"Storage Location",
	Vendor,
	SubField(ApplyMap('LOCATION_IN',"Storage Location",Null()),'|',2) as [IN],
	ApplyMap('LOCATION_EX_RISK',"Vendor",Null()) as [OUT]
	...
FROM ...

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
SCM
Contributor
Contributor
Author

thank you for your help