Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tJavaFlex - is that 1 input row automatically generate 1 output row?

I try following example:

1. Load a .csv file which contains 100 rows of data

2. Use tJavaFlex to create many segments, which contains 10 rows (mean that we have 10 segments for my sample data)

The tJavaFlex as follow:

StartCode:

int rowCount = 0; 
int currentBatch = 0; 

Main Code:

if(rowCount%10==0 && rowCount!=0)
{
       //row4 = new row4Struct();
	row4.StartIndex = rowCount;
	row4.SegmentIndex = currentBatch;
	currentBatch++;
}
rowCount++;

and End Code

//row4 = new row4Struct();
row4.StartIndex = rowCount;
row4.SegmentIndex = currentBatch;

Do I need to declare ''//row4 = new row4Struct();" ?

And why the result return 100 rows, not 10 rows that I expect?

0683p000009M8Pu.png

 

 

 

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi
Yes, tJavaFlex always generate one output for each input row, so you can't create the segments like that.

Regards
Shong
Anonymous
Not applicable
Author

Hello @shong 

 

If so, the IF statement does not work, right?

if(rowCount%10==0 && rowCount!=0)

 and if it generate one output for each input, I don't need to declare new the row4 ouput as followed, right?

row4 = new row4Struct();