Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a 'normal loading procedure and a mapping load. I would like to pass a variable to pass to this mapping load to be used within a subfield.
Within this example : the outcome of ApplyMap('Contact', Rel_Source_ID, '') is stored to the variable $Variable. This value $Variable should be used to read the nth field of the field Itemlijst where the Source_ID is the 'search string' for this mapping.
//Search nth items from list
ContactListText:
MAPPING LOAD Source_ID, // bedr + rel code + middel
SubField([Itemlijst],';',$Variable) // rubriek waarde
from xxxx;
Load *,
applymap ('ContactListText', Rel_Source_ID, 'blanc') as RelText
load *,
ApplyMap('Contact', Rel_Source_ID, '') | AS $Variable, |
resident Sourcetable.
How many items the itemlist contains, could vary
A load statement returns records with fields that have values. A load statement cannot directly assign a value to a variable. So applymap cannot store a value in a variable. The AS $Variable would create a field named $Variable.
If you want to use the variable in the subfield function then you need to create that variable before creating the mapping table. The mapping table must exist before an applymap can use it to look up values.
Oke, I only could store my outcome into a fieldname. Would that help me as I only could pass one parameter within the "applymap"
Two questions remains:
1. How to store a field value within the LOAD to a (global) variable
2. Could I use this variable within my mapping request as I only could pass 1 parameter to the applymap.
I have to search using two parameters: the first param is Rel_Source_ID and the second this variable (to be used within my SubField request...
sorry G Wassenaar, but not sure how to use your suggestion within my problem..? For each record these values could vary, so using Max() is not an option.