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

[resolved] Please help me with RUNif condition for TfileRowcount

HI Team ,
I need check whether file is empty or not , for that I m using TfileRowcount  to get total number of records what condition do I  need to write in runif . If number of records zero it should file is empty or it should display totalnumber of records ...................
thanks!
0683p000009MBvP.png
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
If file exists,  you can use a tFileRowCount to populate the number of lines, there is a global variable called ((Integer)globalMap.get("tFileRowCount_1_COUNT")) that stores the result. eg:
tFileExist--runIf--tFileRowCount--oncomponentok--tFixedFlowInput--main--tLogRow
on tFixedFlowInput, generate the number of lines, define one column let's say it as "nb_line", set its value as:
((Integer)globalMap.get("tFileRowCount_1_COUNT"))
Best regards
Shong

View solution in original post

4 Replies
Anonymous
Not applicable
Author

You can do this by following the image I have attached to this post. The file has a parameter called "number of lines". This can seen circled in red on the left. Drag this over to your RunIf link component condition. Then set the greater than/less than logic you require. You don't actually need the row count component.

0683p000009MBvU.png
Anonymous
Not applicable
Author

Thanks rhall, its working but
But my requirement if the file is empty it job should abort with message " No records" if not it should give me total number of records .......for my auditing purpose ..  above solution is not giving me total number of records could you please help me with how I can fetch total number of records ..
Thanks
Mohini
Anonymous
Not applicable
Author

Hi
If file exists,  you can use a tFileRowCount to populate the number of lines, there is a global variable called ((Integer)globalMap.get("tFileRowCount_1_COUNT")) that stores the result. eg:
tFileExist--runIf--tFileRowCount--oncomponentok--tFixedFlowInput--main--tLogRow
on tFixedFlowInput, generate the number of lines, define one column let's say it as "nb_line", set its value as:
((Integer)globalMap.get("tFileRowCount_1_COUNT"))
Best regards
Shong
Anonymous
Not applicable
Author

Many thanks Shong its working .............
0683p000009MACn.png
MOhini