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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Morgoz
Contributor III
Contributor III

Set a variable with the total number of rows

 

Hello,

I need to set a variable with the total number of rows from a table.

To achieve this, I've done the following:

 

 

TOTAL_ERRORES:
LOAD Count(ID_REGISTRY) as total_errores RESIDENT DQ_REGISTRY;
LET total_errores = if(isnull(Peek(total_errores,0,TOTAL_ERRORES)),0,Peek(total_errores,0,TOTAL_ERRORES));

 

 

Could you please tell me if this is the better/simpler way to do it?

Thank you.

 

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Try using the NoOfRows() function:

Let total_errors = NoOfRows('TOTAL_ERRORES')

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

Try using the NoOfRows() function:

Let total_errors = NoOfRows('TOTAL_ERRORES')

Morgoz
Contributor III
Contributor III
Author

Thak you Gary,

anyway, the correct expression was 

Let total_errors = NoOfRows('DQ_REGISTRY')

But it works. Thanks.