on 03-13-2009 1:49 PM
Hi,
My requirement is as below:
Input queues are
4319, 4319,4320,4321,4321
M1,M1,M1,M2,M2,M2
Required output is
4319,4320,CC,4321
COntext change is to be inserted when there is a change in value in second queue.
regards, Anirudh.
Suppose you have two parameters a and b:
a - 4319 queue
b - M queue
Your going to use two FormatByExamples:
The last one take two paraters:
First Parameter:
a->removeContext->SplitByvalue[ValueChange]->CollapsContext ---------------------------------------------------->
Second Parameter:
b->removeContext -------------------------->
FormatByexample -> CollapsContext->RemoveConext -> SplitByValue[Value Change]----->
a->removeContext->SplitByvalue[ValueChange]->
It should work this time.
Liang
Edited by: Liang Ji on Mar 13, 2009 4:15 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You may use the mapping below:
input1 is the input with M1, M2
input2 is the input with numbers
input1-->removeContext--> concat --> splitByValue:ValueChanged --> collapseContext --> removeContext --> substring (2..6) --> formatByExample (1) --> Target
input2-->removeContext--> /
input1-->removeContext--> concat --> splitByValue:ValueChanged --> collapseContext --> removeContext --> substring (0..2) --> splitByValue:ValueChanged -->formatByExample (2)
input2-->removeContext--> /
The code is too long without UDF, but it will work
Hope this helps,
Edited by: Mark Dihiansan on Mar 13, 2009 3:38 PM
Edited by: Mark Dihiansan on Mar 13, 2009 3:42 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you tried using the formatByExample as specified?
input1-->removeContext--> concat --> splitByValue:ValueChanged --> collapseContext --> substring (2..6) --> formatByExample (1) --> Target
input2-->removeContext--> /
input1-->removeContext--> concat --> splitByValue:ValueChanged --> collapseContext --> substring (0..2) --> splitByValue:ValueChanged -->formatByExample (2)
input2-->removeContext--> /
code explanation
input1 and input 2 when concatted outputs M12319,M12319,M12320,M22321,M22321,M22321
The upper part of the code does this: M12319,M12320,M22321, when you use the substring it outputs now 2319,2320,2321
The lower part of the code does this: M12319,M12320,M22321, when you use the substring it outputs
M1,M1,M2, then you use splitByValue. The output is now M1,M1,CC,M2.
When you input the code from the upper part and lower part into a formatByExample node, the output becomes
2319,2320,CC,2321
Hope this helps,
Apply Split by value on value change on second queue
then
ApplyFormat by example on 1st queue (use second queue as formatting example)
and then finally
Apply Collapse context on first queue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
requirement is
4319 M1
4319 M1
4320 M1
4321 M2
4321 M2
4321 M2
output shoud be
4319
4320
4321
there should be a context change between 4320 and 4321
as 4319 and 4320 belong to same M1 and 4321 belong to M2.
I am able to generate queue 4319,4320,4321.
but I am not able to insert CC between 4320 and 4321.
I want to do it without UDF.
regards, Anirudh.
Suppose you have two parameters a and b:
a->removeContext------------------------------->
FormatByexample --> UDF -->
b->removeContext -> SplitByvalue[ValueChange]-->
UDF, Context type
result.addValue(a[0]);
for (int i =1; i < a.length; i++)
if (a<i>!=a[i-1])
result.addvalue(a<i>);
Regards.
Liang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try using the SplitByValue with Value Changed option.
Regards
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.