on 05-14-2011 8:05 AM
Hi,
I/P:
<Segement1>
<Article>1</Article>
</Segement1>
<Segement1>
<Article>2</Article>
</Segement1>
<Segement2>
<StoreNum>12</StoreNum>
<StoreNum>13</StoreNum>
<StoreNum>14</StoreNum>
</Segement2>
and the output should be like for every unique combination of Article and StoreNum I have to create a target node and the corresponding values in that node: (So in this case the o/p node will come 6 times)
<Detail>
<Article>1</Article>
<StoreNum>12</StoreNum>
</Detail>
<Detail>
<Article>1</Article>
<StoreNum>13</StoreNum>
</Detail>
.
.
.
.
.
<Detail>
<Article>2</Article>
<StoreNum>14</StoreNum>
</Detail>
Can anybody please suggest a solution ?
though i am able to generate the target node as desired using the following UDF but facing the problem while populating unique set of values in the target node.
String a="";
for(int i=0;i<var1.length;i++)
{
for(int j=0;j<var2.length;j++)
{
a= var1 i (in square barckets)+var2[j];
result.addValue(a);
}
}
Edited by: jayagupta21 on May 14, 2011 9:36 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
articleremovecontext-sortsplibyvalue(valuechange)-collapsecontext
-
UDF---details
storenumsort-splitbyvalue(valuechange)--collapsecontext
mapping of the elements inside details node can be achieved using UDF or standard function also.
UDF2
for(int i=0;i<var1.length;i++)
{
for(int j=0;j<var2.length;j++)
{
result.addValue(var1<i>);
result.addContextchange();
}
}
repeat the same mapping for Article(target filed) using udf2 as mentioned above for details...
UDF3:
for(int i=0;i<var1.length;i++)
{
for(int j=0;j<var2.length;j++)
{
result.addValue(var2<i>);
result.addContextchange();
}
}
repeat the same mapping for Storenum(target filed) using udf3 as mentioned above for details...
Note: check for syntax errors.....
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.