Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Validate the file and process if the row count>0

Dear Experts,

 

I am trying to process set of file in a directory, would like to check all the files and it's record count. flow 1 - process the files which has record count>0 flow 2 - move the empty file to audit folder.

 

I tried the below approach, end with the error.

 

 

0683p000009MA2K.png

Labels (2)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@prithivt ,can you try below one working.



if(input_row.size!=null && input_row.size==0){
globalMap.put("isEmpty", true);
}else{
globalMap.put("isEmpty", false);
}

 

View solution in original post

4 Replies
manodwhb
Champion II
Champion II

@prithivt , what are you doing in tJavarow? Please share what you have written, since you need to apply nulvalidation first and then you need to do other part like calculation other stuff.

 

 

Anonymous
Not applicable
Author

Thank you for your response.

 

Below is my code to check the file size in tJavaRow component. after that by using the isEmpty variable i am creating two flows to process further,

if(input_row.size==0){

System.out.println("File record count is 0");

globalMap.put("isEmpty", true);

}

 

else{

System.out.println("File record count is > 0");

globalMap.put("isEmpty", false);

}

 

 

 

 

manodwhb
Champion II
Champion II

@prithivt ,can you try below one working.



if(input_row.size!=null && input_row.size==0){
globalMap.put("isEmpty", true);
}else{
globalMap.put("isEmpty", false);
}

 

Anonymous
Not applicable
Author

Thank you it is working now.