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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] How to insert a counter to evaluate correct and incorrect rows

Hi !
here's the context :
- i have a txt file with more than 200k lines.
- it is a positional file, correctly entered in talend (74 columns)
- each line has a fixed string content, then a variable one (depends on entries before).
In addition, some lines are not properly entered, and we don't need to include these lines in our datamining project.
I want to count the number of correct line and incorrect line, so after the positionalFile, i put a tJava initiliazing the 2 counters (int correct and int incorrect) , then i put a tJavaRow where i increment the variables when the conditions are met, then i put a tJava to println the variables.
The problem is that the last tJava doesn't recognize the variables.
I tried to make them global, but it is not working.
I tried to insert it in the tJavaRow but, they print in each line read the values... it works but it is not clean..
If anyone have a good way to do so, it would help me a lot !
Thank you !
Labels (3)
10 Replies
Anonymous
Not applicable
Author

tjavrow -> main ->tfilterrow ->main -> outcomponent
|rej
outcomponent
edit schema of tjavarow and add a boolean type column and set the flag to 1 if condition/conditions are met and verify the condition:
If(condition)
out_row.flag=1;
else
out_row.flag=0;

exactly the right thing to do ! working perfectly and i find the same results as with my messy way 0683p000009MACn.png
You can find a screenshot showing the work in attached.
thank you , you rock !