NoOfRows - chart function
NoOfRows() returns the number of rows in the current column segment in a table. For bitmap charts, NoOfRows() returns the number of rows in the chart's straight table equivalent.
If the table or table equivalent has multiple vertical dimensions, the current column segment will include only rows with the same values as the current row in all dimension columns, except for the column showing the last dimension in the inter-field sort order.
Return data type: integer
If the table is one-dimensional or if the qualifier TOTAL is used as argument, the current column segment is always equal to the entire column.
Example: Chart expression using NoOfRows
Load the following data as an inline load in the data load editor to create the chart expression examples below.
Temp: LOAD * inline [ Region|SubRegion|RowNo()|NoOfRows() Africa|Eastern Africa|Western Americas|Central Americas|Northern Asia|Eastern Europe|Eastern Europe|Northern Europe|Western Oceania|Australia ] (delimiter is '|');
For more information about using inline loads, see Inline loads.
Create a table visualization in a Qlik Sense sheet with Region and SubRegion as dimensions. Add RowNo( ), NoOfRows(), and NoOfRows(Total) as measures.
In this example, the sort order is by the first dimension, Region. As a result, each column segment is made up of a group of regions that has the same value, for example, Africa.
The RowNo() column shows the row numbers for each column segment, for example, there are two rows for the Africa region. The row numbering then begins at 1 again for the next column segment, which is Americas.
The NoOfRows() column counts the number of rows in each column segment, for example, Europe has three rows in the column segment.
The NoOfRows(Total) column disregards the dimensions because of the TOTAL argument for NoOfRows() and counts the rows in the table.
If the table was sorted on the second dimension, SubRegion, the column segments would be based on that dimension so the row numbering would change for each SubRegion.
For more information about expressions, see Using expressions in visualizations.