Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count records

I fetched records to a table-box. I don't know which field is the primary key.Now I want to find the no. of records fetched.

How can I do this?

1 Solution

Accepted Solutions
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

If you click on top of Table box it will show you total rows at bottom . If you want to show the number of rows fetched then you can use function RowNo()  as Rows in your extract and show it in tablebox.

Load

*,

RowNo() as Row

From table.qvd;

Hope this will help.

Vijay

View solution in original post

8 Replies
stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

You can make a "primary key" for this purpose if you know which of the fields make the results unique:

Count(Distinct Field1 & Field2 & Field3)


Regards,

Stephen

lalitinmbd
Partner - Contributor III
Partner - Contributor III

Use a variable

Let Rows=NoofRows(TableName);

$(Rows) will give you the no of records in the table.

stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

NoofRows(TableName) is a script function.

NoofRows() is a chart function so won't work in a table box.

Regards,

Stephen

lalitinmbd
Partner - Contributor III
Partner - Contributor III

Try using Recno() in the script.

nstefaniuk
Creator III
Creator III

You can add a field "ROW_COUNT" with the value 1 in your table and sum(ROW_COUNT). More efficient than count(distinct ...) and you don't need to build a key on the fly. Moreover it can be dynamic with selections in application.

Not applicable
Author

Hi,

I'm new to Qlikview. Please tell me how to add a field in an already existing table-box with data.

I tried adding an inline table to the script with LOAD * INLINE[row_count];

However when I add this to the table-box, the table-box does not show any value.

Thanks,

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

If you click on top of Table box it will show you total rows at bottom . If you want to show the number of rows fetched then you can use function RowNo()  as Rows in your extract and show it in tablebox.

Load

*,

RowNo() as Row

From table.qvd;

Hope this will help.

Vijay

Not applicable
Author

Thank you all,

I got the solution by adding Rowno() function as suggested by Vijay