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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
RA6
Creator
Creator

Output rejection based on specific condition

Hello,

 

My idea is to :

1. count the delimiters per line

 

tjavarow

output_row.line = input_row.line;
context.DelCount = StringHandling.COUNT(input_row.line, ";");

 

2. gather rows not equal the default delimiters value

 

tmap => Expression filter

context.DelCount < 10

 

3. Finally i used a tjavaflex to check if i have any rejection.

 

if(nb==0){
globalMap.put("hasData",false);
}else {
globalMap.put("hasData",true);

 

 

0683p000009Lt6k.jpg

 

What i am not able to do:

 

If there is any rejection ("hasData",true), i want to output all the rows in a file then finally die.

 

tjavaflex cannot get the schema from the tmap i guess.

 

Any idea how to handle this?

 

Best regards,

asadasing

Labels (3)
1 Reply
RA6
Creator
Creator
Author

@rhall
If another word i want to output the file only if it contain a row