I have input data coming as :
In_Field A
-----------
1a
2e
3f
7h
8t
.
.
.
n
I need to map this input field value to 3 separate output fields.
Ot_FieldA Ot_FieldB Ot_FieldC
--------------------------------------
1a 2e 3f
7h 8t ....
... .... ....
I dont have any input field to group by the set (3 rows).
Please help.
Abhik.
Vertical Pivot without any grouping column
Moderators: chulett, rschirm, roy
Create a grouping column then pivot. It can be as simple as a number you increment every 3 rows and then drop post-pivot. Be careful with your partitioning, of course. If you are on 8.5+ you could use transformer looping for this rather than the Pivot stage.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi Abhik05,
You may try this through transformer-
step 1-
take 2 stage variable-
step2- In derivation constraint-
step3- deriavtion
You may try this through transformer-
step 1-
take 2 stage variable-
Code: Select all
If DSLink105.col1 <> SV1 Then SV1:" ": DSLink105.col1 Else @FALSE SV1
@PARTITIONNUM + (@NUMPARTITIONS * (@INROWNUM - 1)) + 1 SV2
Code: Select all
Mod(SV2,3) ="0"
Code: Select all
Field(Field(SV1," ", (Dcount(SV1," ")-3)+1, Dcount(SV1," "))," ",1) col1
Field(Field(SV1," ", (Dcount(SV1," ")-3)+1, Dcount(SV1," "))," ",2) col2
Field(Field(SV1," ", (Dcount(SV1," ")-3)+1, Dcount(SV1," "))," ",3) col3
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
If you're going with a Transformer based approach, remember to include "Or LastRow()" in the output constraint in case your data doesn't have an exact multiple of three rows.
I'm not sure I like the idea of concatenating with spaces and then splitting. I'd rather gather the values in three Stage Variables. Just because the example doesn't have spaces, doesn't mean that the data never will. Why not concatenate with and split on an 'x' because, after all, none of the examples have an 'x' in them!
Also, I feel the need to reiterate chulett's warning about partitioning. The premise of your problem practically precludes partitioning, so you may have to use Sequential execution mode, a Node Map constraint, or partitioning on a fixed value.
I'm not sure I like the idea of concatenating with spaces and then splitting. I'd rather gather the values in three Stage Variables. Just because the example doesn't have spaces, doesn't mean that the data never will. Why not concatenate with and split on an 'x' because, after all, none of the examples have an 'x' in them!
Also, I feel the need to reiterate chulett's warning about partitioning. The premise of your problem practically precludes partitioning, so you may have to use Sequential execution mode, a Node Map constraint, or partitioning on a fixed value.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant