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: 
Anonymous
Not applicable

tFileRowCount, read "0 rows" without "null pointer exception"

Hi, the job works as follows:

I need to recover data from the WS, so if the WS returns 0 data (0 rows), I need to throw an exception, not the "NullPointerException". I tried with the "tFileRowCount" to read the rows, if rows == 0 throw exception otherwise "tfileOutputDelimited", and it did not work. I made screenshots to make it clear at the job level: someone can help me plzz!0683p000009M0SZ.png

 

0683p000009M0TC.png

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thank you for your answer, I will test it later.

Beside that, I found the solution that meets my needs;
we do a test with the "if":  

((Integer) globalMap.get (" tLogRow_1_NB_LINE ")) == 0

If the WS returns 0 data, we generate empty files but with a warning message "WARNING :: This WebService is down and returns No Data" with the tDie.
I hope it will help you one day 0683p000009MACn.png

0683p000009M0Uu.png0683p000009M0Vv.png

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi,

 

     Could you please try the below method? Here, when I am specifying zero records in trowgenerator, no records will be written into the target file. I have allowed the subjob to complete. I verified the number of records loaded by the pseudo variable NB_LINE linked to tfileoutputdelimited (use control space to view it) and add it as condition in Run if line 

 

((Integer)globalMap.get("tFileOutputDelimited_1_NB_LINE")) ==0

 

This resulted in printing the value in second tjava job. The concept remains same for your job also.

 

If the answer has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂

 

0683p000009M0Vb.png

 

 

 

Warm Regards,

 

Nikhil Thampi

Anonymous
Not applicable
Author

Thank you for your answer, I will test it later.

Beside that, I found the solution that meets my needs;
we do a test with the "if":  

((Integer) globalMap.get (" tLogRow_1_NB_LINE ")) == 0

If the WS returns 0 data, we generate empty files but with a warning message "WARNING :: This WebService is down and returns No Data" with the tDie.
I hope it will help you one day 0683p000009MACn.png

0683p000009M0Uu.png0683p000009M0Vv.png