on 06-01-2006 9:14 PM
Hi all,
We have the following requirement:
SOurce:
< Header/>
.....
<items 0 to unbounded/>
<item_status/>
.....
Target:
<Header/>
<Header_status/>
...........
.....
...
The Header Status on the target needs to be populated based on the following req:
If all Source items status = A, Target Header status = 0
all Source items status = B, Target Header status = 1
otherwise Traget Headr Status = 3
Please let me know if this can be hnadled with out use of user defined funtion.
Thanks for your help in advance,
Balaji
hi,
>>>>all Source items status = B,
this cannot be handled without user defined function
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a Advanced UDF with cache as Queue and try this code:
public void Status_test(String[] item_status,ResultList result,Container container)
{
int j=0,Status_A=0, Status_B=0;
for (j=0;j<item_status.length;j++)
{
if (item_status[j].equals("A"))
Status_A++;
else if (item_status[j].equals("B"))
Status_B++;
}
if (Status_A==item_status.length)
result.addValue("A");
else if (Status_B==item_status.length)
result.addValue("B");
else result.addValue("C");
}
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me take a shot at this.....
LBL_A = (item_status -- removecontext -- sort -- splitbyvalue(valuechanged) -- collapsecontexts -- removecontext)
LBL_A -- count
equalsA -if -- /
constant(1)
then -- LBL_A
equalsS -- then output="0" else output = "1"
/
constant A
there is not enough space to write it here...:( ...hope you get the idea...how to go about doing it....
definitely it is do-able without a udf....
Thanks,
Renjith
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 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.