on 02-20-2008 11:18 AM
Hello Experts,
Is it possible to do such a graphical mapping:
source:
<item>
<indicator>1</indicator>
<data>
<value>a</value>
</data>
</item>
<item>
<indicator>2</indicator>
<data>
<value>b</value>
</data>
</item>
<item>
<indicator>1</indicator>
<data>
<value>c</value>
</data>
<data>
<value>d</value>
</data>
</item>
<item>
<indicator>1</indicator>
</item>
result:
<data>
<value>a</value>
</data>
<data>
<value>c</value>
</data>
<data>
<value>d</value>
</data>
The data elements should be taken from items with indicator equals to 1. The problem is, that each item can have 0..unbounded data elements. And that is why, for example the 5th data doen't always correspond to 5th indicator.
So how to do this mapping?
Thanks in advance for your help.
Try eith this Graphical mapping Solution and let me know if u face any issue.. Hopefully this is it.
1) Indicator & constant ("1")----> equals(text) ---> creatif(node function) ---> Data (target)
2) value (source)----> value (target)
Notes:
a) change the context of indicator to Item's Parent
b) EqualS is function from Text functions. First arg is "indicator" and 2nd is Constant with value =1
No need to use UDF for this.
Regard.s
JEet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
i think your requirement is still not clear.
Is your example the way you would like to have it,
because the value 'c' is on second position (in result) but comes from the third indicator (in source).
Please describe exactly what do you want to have.
Do you want maybe something like this:
<data>
<value>a</value>
</data>
<data>
</data>
<data>
<value>c</value>
<value>d</value>
</data>
<data>
</data>
Regards
Patrick
Hello,
thats good to know.
It's possible to make a mapping like you described in your first message,
but then you have this problem:
> And that is why, for example the 5th data doen't always correspond to 5th indicator
To solve this problem i guess you have to change your target structure, but you have to say how a solution should look like and then it's possible to find a mapping for this solution.
Regards
Patrick
Hi,
This is Possible by writing a Advance user defined .Pass the Indicator as in input and check if it is equal to 1 then put as result.addValue of data else result.addsuppresslist
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Artsiom,
If indicator = 1, then map (source) item -> data -> value to (result) item -> data -> value, with the context of 'data' and 'value' set to 'item' level.
Thanks,
Varun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Varun, Aashish
thanks for your responses, but your solutions will not work, because as I already mentioned there can be a couple of datas in one item, but the IF element will compare them by the sequance they are appear in message (like 1st with 1st, 2nd with 2nd .... etc), but, for example, the 5th indicator not always corresponds to the 5th data (if in previous items there was number a datas not equal to 1).
Hi,
yes it is quite possible using graphical as well as Java mapping.
Graphical mapping :
Use If - else - if to check the condition and map it to the target location.
In Java Mapping :
write an UDF and do the conditional mapping there as you do it in Java. In this UDF check out the <indicator>1</indicator> value, if it is one then it will go to target.
Regards
Aashish Sinha
PS : reward points if helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.