IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

generic Lookup Function Options · View
ejohann
Posted: Tuesday, November 3, 2009 1:27:40 PM
Rank: Advanced Member

Joined: 11/2/2009
Posts: 38
Location: cinti, Ohio
I'm still learning the MapForce tool, but I've been unable to find a way to provide what I need. All of the lookup examples I've seen share the fact that the function has to know the target of its results, because it has to place the result in a structure.

I'm really trying to make a higher performance version of a value-map, where I put criteria in, and get a string value out, that I can reuse and place the result on any target.

There are several nice examples of ways to do the lookup I want,(find the value in a conversion table), but I can't seem to find a way to return a simple string from my User Function. (so I can reuse it)



ejohann attached the following image(s):
MapforceLookup.png

vlad
Posted: Tuesday, November 3, 2009 1:44:11 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
The solution in you case is to connect pplusFieldValue to the "table" input of WHERE component. In this case the "result" of WHERE is this field value.
ejohann
Posted: Tuesday, November 3, 2009 4:45:36 PM
Rank: Advanced Member

Joined: 11/2/2009
Posts: 38
Location: cinti, Ohio
Thank you for the quick reply. Let me be sure I understand it.

Are you saying I can replace the table connected to the sql-where with just the field I want to return? Does the WHERE process infer the table to filter from the container of the field connected to the Table connector?

Is there any reference information on some of these functions? It would be very helpful to understand the various ways powerful functions like this can be used.

Eric
ejohann
Posted: Sunday, February 6, 2011 8:17:11 PM
Rank: Advanced Member

Joined: 11/2/2009
Posts: 38
Location: cinti, Ohio
Your answer worked great! Then (of course) my requirements changed.

I'm still in a lookup function, but I need to return 2 bits of information, not just one. The documentation shows selecting a table row, then taking the columns needed and map them to the children in the target. In my function, I have no such structure. (see image)

Suggestions?


ejohann attached the following image(s):
InnerCodeLookup.png

vlad
Posted: Sunday, February 13, 2011 8:36:52 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
A function must have a single output which can be any tree too. Just use one of the existing trees or create one just for this function (I would do this with a CSV output, as it allows to easily add columns - in this case output values).
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.