Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
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
tresesco
MVP
MVP

Then, you wont get directly using aggr(). May be some tricky way that depends on your calculated dimension expression could help. Try to post your sample app.