Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

mf_mipmanit
New 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
jerrytan90
New Contributor III

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

try rowno(total) as expression

mf_mipmanit
New Contributor III

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

That also returns 1 every time

Not applicable

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

Try rowno()

mf_mipmanit
New Contributor III

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

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

jerrytan90
New Contributor III

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

can attached the sample qvw have a look?

Not applicable

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

Try the expression =NoOfRows(Total)

sergey_maka8
Valued Contributor

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

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)

mf_mipmanit
New Contributor III

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

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.

MVP
MVP

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

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

Community Browser