on 01-16-2009 6:06 AM
Hi,
I have a input structure like below; I need to produce output structure based on Student_no...
scenario 1: If 5 different student number records there...Need to create 5 records in output structure. If the same student info comes more than one time- create only one record to corresponding student and count the subjects.
scenario 2: sometimes input structure may miss the student no...then I need to create blank record or segment only with the marks info.
Input structure:
DT_Student_Input
Student_Details --- 1 - Unbounded
Student_No-- 0 -1
Section_Name -- 0-1
Marks_Info -
1--- Unbounded
no.of marks 0-1
Note: Marks_info is sub element of Student_Details
help me out!!!
-S
Edited by: stallin xavier on Jan 16, 2009 7:08 AM
Edited by: stallin xavier on Jan 16, 2009 7:09 AM
Edited by: stallin xavier on Jan 16, 2009 7:20 AM
Hi,
1. Check if the Student_No is blank then if YES then fill it with a Node Index (or some Unique value) and then concatenate with some common string (eg: ###).
Eg :
Rec1 : StudNo = 10001
Rec2 : StudNo =
Rec3 : StudNo = 10002
Rec4 : StudNo =
Rec5 : StudNo = 10001
Output should be
Rec1 : StudNo = 10001
Rec2 : StudNo = 2###
Rec3 : StudNo = 10002
Rec4 : StudNo = 4###
Rec5 : StudNo = 10001
2. Then use removeContext to remove all the context and the SORT
Eg :
<ContextChange>
Rec1 : StudNo = 10001
<ContextChange>
Rec2 : StudNo = 2###
<ContextChange>
Rec3 : StudNo = 10002
<ContextChange>
Rec4 : StudNo = 4###
<ContextChange>
Rec5 : StudNo = 10001
<ContextChange>
Output
<ContextChange>
Rec1 : StudNo = 10001
Rec2 : StudNo = 10001
Rec3 : StudNo = 10002
Rec2 : StudNo = 2###
Rec4 : StudNo = 4###
<ContextChange>
3. Then CollapseContext and then SplitByValue (EachValue)
Output
<ContextChange>
Rec1 : StudNo = 10001
<ContextChange>
Rec3 : StudNo = 10002
<ContextChange>
Rec2 : StudNo = 2###
<ContextChange>
Rec4 : StudNo = 4###
<ContextChange>
4. Then check if a Student_No has ### then blank it out before assigning to the target.
This way you can eliminate duplicates and also take care of the BLANK. But the records will get sorted hence while assigning the other fields to the target you need to take care of this.. either by SORT or any method you prefer.
Thanks,
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Kindly provide the target structure so that we can visualize which fields should be mapped from the source.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can try like this for student number.
Student_No ---->Sort(node Function)----->SplitByValue(NodeFunction)--->Target
Set the context to the parent level for student_no.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
for your scenario 1
you need to write a udf where u need to increment your student no and check if not equals and then map it to target node.....
scenario 2
use if standard function ,
check if startswith constant (null)
In then set your condition to pass marks
and in else pass the normal source field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your quick comments on this....But my case is not the blank value....In the absense of that node ( Student_no). Even if this node is not present..I need to produce corresponding values as a separate record. Any comments on this would appreciated with the points.
-S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
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.