Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Error using 2 ApplyMap consecutively

Hi, while I'm loading a table I use ApplyMap to add a new field this way:

  ApplyMap('MapGestSuppliers',LotNumber,Null()) AS SupplierID,

So I get the field SupplierID, but If I add a second ApplyMap, this way

ApplyMap('MapGestSuppliers',LotNumber,Null()) AS SupplierID,

ApplyMap('Map_CustVendorName',SupplierID,Null()) AS SupplierName

trying to use the first result (SupplierID) in the second mapping It gives an error while loading the table

Field <SupplierID> Not found.

If I can't do this this way, how can I add later another field to the table previously loaded.

Thanks

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Error using 2 ApplyMap consecutively

Hi Pedro,

you cannot use SupplierID field this way, as it is not created yet. You can try with the following:

ApplyMap('MapGestSuppliers',LotNumber,Null()) AS SupplierID,
ApplyMap('Map_CustVendorName',
ApplyMap('MapGestSuppliers',LotNumber,Null()),Null()) AS SupplierName

or create two load statemets, the first one with

ApplyMap('MapGestSuppliers',LotNumber,Null()) AS SupplierID

and the second with

ApplyMap('Map_CustVendorName',SupplierID,Null()) AS SupplierName

regards

2 Replies
Not applicable

Re: Error using 2 ApplyMap consecutively

Hi Pedro,

you cannot use SupplierID field this way, as it is not created yet. You can try with the following:

ApplyMap('MapGestSuppliers',LotNumber,Null()) AS SupplierID,
ApplyMap('Map_CustVendorName',
ApplyMap('MapGestSuppliers',LotNumber,Null()),Null()) AS SupplierName

or create two load statemets, the first one with

ApplyMap('MapGestSuppliers',LotNumber,Null()) AS SupplierID

and the second with

ApplyMap('Map_CustVendorName',SupplierID,Null()) AS SupplierName

regards

Not applicable

Re: Error using 2 ApplyMap consecutively

Thanks Krunoslav, I've used the first method and it works for me.