Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hey!
i am getting input from api's and want to show in Tlogrow.
but when i split one row values into multiple rows in tjavarow then getting only one last row instead of all 3
my javacode is this
// Input columns
String PARMETADAT_ID = input_row.PARMETADAT_ID;
// Split each column into multiple rows
String[] PARMETADAT_ID_Values = PARMETADAT_ID.split(",");
// Iterate over the arrays and output each combination
for (int i = 0; i < PARMETADAT_ID_Values.length; i++) {
// Set the PARMETADAT_ID for the current iteration
row11.PARMETADAT_ID = PARMETADAT_ID_Values[i];
// Output the row
System.out.println("Output Row: " + row11.PARMETADAT_ID);
// Emit the row (if you're using an output link)
output_row = row11;
// ... (any additional logic or processing)
}
output:
Output Row: 6c4e33bb-a7c8-4d71-8594-868eefeb841f
Output Row: 75b9248a-5228-4e69-a862-c0927d5a66ca
Output Row: 9ed56adf-063d-4438-b205-ad4b3b2b0844
.------------------------------------.
| tLogRow_3 |
|=----------------------------------=|
|PARMETADAT_ID |
|=----------------------------------=|
|9ed56adf-063d-4438-b205-ad4b3b2b0844|
'------------------------------------'
row11 is my output link to the tlogrow and PARMETADAT_ID is my column name
my job design is this
my job design
my tmap output is for one column
123haskjdjkasd,12321uiasdhjksdahsk,2132jhsahdsjadjkasdhjk,
if i use tnormalize component then i will have to use multiple tnormalize components but its not good approach i thnk so
please help me
Hi
tJavaRow does not iterate each row to next component (tLogRow_3), it only output one row for each input data. You can append the PARMETADAT_ID string on tJavaRow and only use one tnormalize after tJavaRow. eg:
String temp_PARMETADAT_ID_string="";
// Input columns
String PARMETADAT_ID = input_row.PARMETADAT_ID;
// Split each column into multiple rows
String[] PARMETADAT_ID_Values = PARMETADAT_ID.split(",");
// Iterate over the arrays and output each combination
for (int i = 0; i < PARMETADAT_ID_Values.length; i++) {
// Set the PARMETADAT_ID for the current iteration
row11.PARMETADAT_ID = PARMETADAT_ID_Values[i];
// Output the row
System.out.println("Output Row: " + row11.PARMETADAT_ID);
if(temp_PARMETADAT_ID_string.equals("")){
temp_PARMETADAT_ID_string=row11.PARMETADAT_ID;
}else{
temp_PARMETADAT_ID_string=temp_PARMETADAT_ID_string+";"+row11.PARMETADAT_ID;
}
// Emit the row (if you're using an output link)
output_row = temp_PARMETADAT_ID_string;
// ... (any additional logic or processing)
}
Regards
Shong
Thanks shong for you response
Basically, the issue is I have multiple columns not only PARMETADAT_ID. thats why I am not using tnormalize component.
is there any other way to split one row for multiple columns into multiple rows?
I am stuck in this scenario please guide me if I can handle it in Tjavarow then good otherwise guide me to some other flow
textractjsonfield output
PARMETADAT_ID PARTEXT PARKEY
["21DSA3DSD,21D323S,23SS3DFF"] ["Region, area, test"] ["US, UK, INDIA"]
tMAP output
PARMETADAT_ID PARTEXT PARKEY
21DSA3DSD,21D323S,23SS3DFF Region, area, test US, UK, INDIA
THANKS
what's the output you expect? Do you want to generate three output for each column or only one output for all columns like this:
PARMETADAT_ID;PARTEXT;PARKEY
21DSA3DSD;Region;US
21D323S;area;UK
23SS3DFF;test;INDIA
i want only one output like you said
PARMETADAT_ID ;PARTEXT; PARKEY
21DSA3DSD ;Regio; US
21D323S ;area; UK
23SS3DFF ;test; INDIa
My current output is this
One row with multiple values of columns
PARMETADAT_ID ;PARTEXT; PARKEY
21DSA3DSD,21D323S,23SS3DFF ;Region,area,test; US,UK,IDIA
My requirement is this
split values of the column into multiple rows
PARMETADAT_ID ;PARTEXT; PARKEY
21DSA3DSD ; Regio ; US
21D323S ; area ; UK
23SS3DFF ; test ; INDIa
@Shicong Hong i am waiting your reply
please guide me
You must use tNormalizer to split one column into several rows. In this exemple, the input is the one you specified : 123haskjdjkasd,12321uiasdhjksdahsk,2132jhsahdsjadjkasdhjk
The output is 3 rows. is that what you are looking for ?
You need to be more precise when you describe your problem. It's not that clear.
my input is this
col1 ; col2 ; col3
1,2,3,4 ; A,b,c,d ; w,x,y,z
i need output
col1; col2 ; col3
1 ; A ; W
2 ; B ; X
3 ; C ; Y
4 ; D ; Z
I have multiple columns like up to 10 I cannot use 10 tnormalize components
please guide me with some solution
Hello,
The solution is the following, given that the number of columns and the number of elements per column is stable : Using a tSplit and getting each element with a split() and the corresponding index :
my indexes are dynamic bro its not static .
this solution is for static values of indexes