on 12-15-2009 11:22 AM
Hello Forum
I have a structure similar to that:
<ITEM>
<KEY>3</KEY>
<VALUE>sth1</VALUE>
</ITEM>
<ITEM>
<KEY>7</KEY>
<VALUE>sth1</VALUE>
</ITEM>
<ITEM>
<KEY>1</KEY>
<VALUE>sth1</VALUE>
</ITEM>
<ITEM>
<KEY>2</KEY>
<VALUE>sth1</VALUE>
</ITEM>
Now I would like to sort the knots by the KEY value. Is there any possibility to do that with the standard sort functions?
Thanks in advance for any comments.
Regards
Christian
Hi Christian,
Try this:
Key -->removeContext --> sort --> splitByValue(eachValue) --> Target field
Value --> removeContext --> sortByKey( To second argument) --> splitByValue(eachValue) --> Target field
To the first argument of 'sortByKey' join the field 'Key'.
-Tanaya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Tanaya
Thanks a lot, that was it.
I thought, that there must be a more simple way, that you can just sort the <ITEM>s, but this way is also okay, as I only have six values to sort...
Regards
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
Have you tried like this
Key>mapwithDefault>removecontext>sortbykey->splitbyValue-->targetfield
Value>mapwithDefault>removecontext-->
If you are not successful be sortbykey there is no other standard node function to do this, you need to write a udf,,..
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chirstian,
Use node function Sortbykey.
Key->RemoveContext->Sortbykey-->key.
Regards,
Sateesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
Two approaches are there:
1. Use standard node function sortbykey
2. use udf
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.