โ04-24-2023 11:31 PM
If Iteration 1 then I have to concat all the columns with some special characters and spaces. If the iteration goes to 2nd time them concat all the columns with some special characters and spaces like this we need data for 4 iterations.
EX: IF @ITERATION=1 THEN ($TYP : $A : $B : โAโ : $C : SPACE(6) : $$CD : SPACE(17) )ELSE IF @ITERATION=2 THEN ($TYP : $A : $B : โBโ : $NO : $G : SPACE(31) )ELSE IF @ITERATION=3 THEN ($TYP : $A : $B : โ$Cโ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )ELSE ($TYP : $A : $B : โDโ : $NO : SPACE(61) : $D )
@dmiller @bojanvelevski Please help on this topic
Solved! Go to Solution.
โ05-22-2023 11:34 PM
Iteration condition: IF @ITERATION=1 THEN ($TYP : $A : $B : โAโ : $C : SPACE(6) : $$CD : SPACE(17) )ELSE IF @ITERATION=2 THEN ($TYP : $A : $B : โBโ : $NO : $G : SPACE(31) )ELSE IF @ITERATION=3 THEN ($TYP : $A : $B : โ$Cโ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )ELSE ($TYP : $A : $B : โDโ : $NO : SPACE(61) : $D )
In mapper split the Iteration conditions into 4 columns with different names
And then make copy of data. map 1st iteration column to $RECORD column and follow the same for remaining 3 iteration conditions. The target column should be $RECORD for all 4 mappers.
After that I used union and capture the $RECORD column in mapper and finally Got the result.
โ08-23-2023 11:21 PM - edited โ08-23-2023 11:23 PM
Iteration condition: IF @ITERATION=1 THEN ($TYP : $A : $B : โAโ : $C : SPACE(6) : $$CD : SPACE(17) )ELSE IF @ITERATION=2 THEN ($TYP : $A : $B : โBโ : $NO : $G : SPACE(31) )ELSE IF @ITERATION=3 THEN ($TYP : $A : $B : โ$Cโ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )ELSE ($TYP : $A : $B : โDโ : $NO : SPACE(61) : $D )
According to this iteration condition, we have to generate the values till to the last iteration i.e., iteration4 ($TYP: $A: $B : โDโ : $NO : SPACE(61) : $D ).
In mapper Iโm getting the $A,$B,$C,$D FIELDS along with those columns need to add spaces โฆ.
In a mapper I have spitted the expression into 4 parts like
ITERATION=1 $TYP : $A : $B : โAโ : $C : SPACE(6) : $CD : SPACE(17)) ---$LVRECORD1
ITERATION=2 ($TYP : $A : $B : โBโ : $NO : $G : SPACE(31) ) ---$LVRECORD2
ITERATION=3 ($TYP : $A : $B : โ$Cโ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )--- $LVRECORD3
ITERATION=4 ($TYP: $A: $B : โDโ : $NO : SPACE(61) : $D ). ) ---$LVRECORD4
In the next mapper
Next mapper
Same for all the 4 source columns I have taken the target as $LVRECORD
Output:
ABCD CD A iteration1
ABCD NO G A iteration2
ABCD CD F DTGH A iteration3
TYP ADNO CD A iteration4
โ04-25-2023 12:06 AM
Hi @sshaik,
Can you please give us more details on this? What would be the outcome if ITERATION is 1 for example?
Thanks
โ04-25-2023 12:17 AM
Concatenating data like 1EmployeeId DescriptionData LastColumnData
Like this We have to Fetch including/adding spaces
โ04-25-2023 12:28 AM
Ok then, I think the match operator will help in this case. Check the documentation: Match Operator
โ04-25-2023 12:35 AM
Thanks bojan will try and get back to you