on 11-26-2009 11:14 AM
Hello
I have a specific requirement where i need to create a target node based on two fileds of the source node. For every unique combination of these two fileds i need to create a node in the target.
for example
Line1
F1
F2
Line2
F1
F3
Line3
F4
F5
Line4
F1
F2
In the target i need a node T 3 times , as there are only 3 unique combinations of fileds (F1,F2) (F1,F3) (F4,F5). My target should be T[1] , T[2], T[3] 3 times only.
How can i achieve this .any help is greatly appriciated.
Thank you.
Adding few poits to Ravi's solution.
1. Set the context of element containing value F1, F2,F3 so on from Line node to its parent node.
eg: for a structure as below default context of value will be @ Line insted replace it to root, you can also use removeContext function for this.
root
--Line
---Value
2. Map the output of Split By Value standard function to collapseContext standard node function and then to target node.
so ur mapping will ne like
fieds(1&2)--> concat --> sort ---> splitByValue --> collapseContext ---> target node.
~SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks collapse context is missing , thats why i couldn't map. I have another requirement , i didn't mention as i didn't want to confuse further. now that the intial problem is solved.
I have another filed say V
for example
Line1
F1
F2
V1
Line2
F1
F3
V2
Line3
F4
F5
V3
Line4
F1
F2
V4
now from the previous condition there will be three T nodes T[1] for Line1 & Line2 ( as F1 and F2 are same) T[2] for Line 2 T[3] for Line3. Now inside node T i need a node say S wihch is dependednt on V . So T[1] should have two S nodes ( as there are two unique values of V.
How can i achieve this.
I hope i am clear . anyone please help.
Thank you .
Hi Santosh
Could you be a bit more detailed please? I will rephrase my requirement , i think i gave slightly wrong requiremnt.
I have another requirement , i didn't mention as i didn't want to confuse further. now that the intial problem is solved.
I have another filed say V
for example
Line1
F1
F2
V1
Line2
F1
F3
V2
Line3
F4
F5
V3
Line4
F1
F2
V4
now from the previous condition there will be three T nodes T[1] for Line1 & Line2 ( as F1 and F2 are same) T[2] for Line 3 T[3] for Line4. Now inside node T i need a node say S wihch is dependednt on V . So T[1] should have two S nodes ( as there are two unique values of V.
output:
T[1]
S1
S2
T[2]
S3
T[3]
S4
Hope i made it a bit more clear
How can i achieve this please
Hi,
removing my post, solution is already given by the poster above.
Edited by: Mark Dihiansan on Nov 26, 2009 12:36 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
case 1: The two fields are like, One Field2 is One level below the Field 1.
In this case, you just need to take the field2-> remove Contexts> Map to the target node.
Case2: The two fields are at same level.
1) Concatenate them.
2) Sort the concatenate value.
2) Use Split by value (At New Value>
4) Map to the target node.
Regards,
ravi Kanth talagana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Using sort and SplitByValue (at value change) node functions could make it ... You may have to tweak the context to achieve your target mapping
Rgds
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.