Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
MAnywar
Contributor III
Contributor III

Help with Use of tjavaRow to iterate between rows.

I am stuck and need help with using trying to use tjavarow to iterate between rows, that are sorted and stored.

Here is how my flow looks like. I am sorting based on the MSH_10 field, but I keep getting terror that row75Struct cannot be resolved as a variable.

I will be glad for any help

Code for the tjavarow:

// Initialize variables f// Initialize variables for storing the extracted field values

String msh10;

 

// Iterate through the sorted rows

while (row75 != null) {

  // Extract the MSH.10 field value from the current row

  msh10 = row75.MSH_10; // Use the exact field name as it appears in your schema

 

  // Print the MSH.10 field value

  System.out.println("MSH_10 Value: " + msh10);

 

  // Perform your processing based on the sorted MSH.10 values

  // Example: If msh10 meets certain criteria, process the row

 

  // Read the next row

  row75 = row75Struct;

}

0695b00000oe7sKAAQ.png

Labels (3)
1 Reply
Anonymous
Not applicable

Hi

row75Struct is not a variable in the generated Java code.

 

To access the input/output column on tJavaRow, use the expression like this:

output_row.columnName=input_row.columnName;

eg:

output_row.MSH_10=input_row.MSH_10;

 

During the job execution, you can only access the current row or last N rows, you can't access the next row. What is your requirement?

 

Regards

Shong