Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lmengesha
Partner - Contributor III
Partner - Contributor III

Syntax Error when executing sub

I have the following sub routine in the scripting environment which keeps giving me a syntax error, although it only gets detected one the sub is called:

Sub traceRowCount(sTable)

     if '$(sTable)' <> ''

          let vNumOfRows = NoOfRows('$(sTable)');

          trace >>> Number of Rows in $(sTable) : $(vNumOfRows);

          let vNumOFRows = null();

     else

          trace >>> No table name specified;

     endif

end sub

the errors occur when it reaches - if, else and endif - lines and I have no idea why, I thought it might be the table name but it isn't. I am relatively new to Qlik tech and don't know much in regards to Qliks Script environment's own language. So where am I going wrong fellas?

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Maybe is missing then at the end of first row.

If .... then

........;

else

--------------;

endif;

View solution in original post

3 Replies
Anil_Babu_Samineni

Looks like you missed CALL function ?? Will you provide full script ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
antoniotiman
Master III
Master III

Maybe is missing then at the end of first row.

If .... then

........;

else

--------------;

endif;

lmengesha
Partner - Contributor III
Partner - Contributor III
Author

Thats exactly what was missing, I can't believe the tutorial missed that tho