Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
michaelfentondata
Partner - Contributor III
Partner - Contributor III

Count number of rows in an expression label of a Straight Table

Is it possible to return the number of rows in my table as part of my expression label?

My table has conditional dimensions, so depending on what the user selects, it may display aggregate values or transaction level values.  I would like my label to display "Avg Rent / Week" if the value is an aggregate, or just "Rent / Week" if the user has selected transaction level details.

I can determine if it is at the transaction level by comparing the count of rows in the table with Sum(PropertyCount).  If the count of rows is less than Sum(PropertyCount), I will display "Avg Rent / Week", if the count of rows = Sum(PropertyCount), I will display "Rent / Week".

I have tried NoOfRows(), but it always returns 1.

If this does not work, an alternative may be to have two expressions (eg. Avg and Sum) and let the user choose which one to display.

20 Replies
Anonymous
Not applicable

try rowno(total) as expression

michaelfentondata
Partner - Contributor III
Partner - Contributor III
Author

That also returns 1 every time

Not applicable

Try rowno()

michaelfentondata
Partner - Contributor III
Partner - Contributor III
Author

I have tried all combinations of NoOfRecords and RowNo and they all return 1 every time, regardless of my selections.

Anonymous
Not applicable

can attached the sample qvw have a look?

Not applicable

Try the expression =NoOfRows(Total)

SergeyMak
Partner Ambassador
Partner Ambassador

If you try to show how many rows in chart table and you have one dimension you can Count(DISTINCT Your_Dimension)

If you have several you can you chose  unique dimension or try something like this

=Count(DISTINCT [Calendar.Year] & Calendar.Month)

Regards,
Sergey
michaelfentondata
Partner - Contributor III
Partner - Contributor III
Author

My table has multiple, conditional dimensions.  I do not know at design time which dimensions the user will be viewing.

This is the basis for needing to know the number of rows.

tresesco
MVP
MVP

Proper use of keyword TOTAL could help you. Try to attach your sample app here.