Get Free Trial

How do I display a Pivot Table row count of value rows only?

Answered
Josh asked on June 16, 2021

Hello,
I want to display a row count for my pivot table, but I want to do so while considering only rows that have data values in it. I don’t want to include header rows or totals in my row count. Headers shouldn’t be included. I only want to count rows with values.
I found this example for row count, but it gives full row count.
https://www.flexmonster.com/question/how-to-count-number-of-row-and-column/

5 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 17, 2021

Hello, Josh,
 
Thank you for contacting us.
 
Flexmosnter does not provide the possibility to retrieve the row count that would not include headers and totals.
 
Please let us know what is the final purpose of this method. This information may help us find a workaround for your case.
 
Looking forward to hearing from you.
 
Kind regards,
Illia

Public
Josh June 21, 2021

The final purpose is to count only data value rows without including the header rows in the count.
For example, in the forum post I previously mentioned, they use a jsfiddle:
https://jsfiddle.net/flexmonster/whacdLyj/
It has 2 header rows. The row count for our purposes should be pivot.gridRowCount() – 2.
How do we reliably include the header row count in our row count calculations?

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 22, 2021

Hello, Josh,
 
Currently, there is no known workaround to count rows and exclude all the header and total rows.
 
Please let us know if other questions arise.
 
Kind regards,
Illia

Public
Josh June 22, 2021

Is it not possible to count the headers and/or total rows?
row count – header row count = desired row count?
 
At the very least, how do I display the pivot table line numbers?
In our case, the row/column line numbers are not currently displayed.
Is there a way to toggle or set this?

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 23, 2021

Hello, Josh,
 
Despite a simple formula, Flexmonster does not provide a possibility to retrieve a number of rows/columns occupied by headers. The same is applicable for rows taken by totals.
 
Concerning rows and columns numeration, we suggest whether the grid.showHeaders property of the Options Object is not set to false in your case. This property indicates whether the spreadsheet headers are visible (true) or not (false).
Here is a JSFiddle for demonstration: https://jsfiddle.net/flexmonster/xw6b4tm5/.
 
We hope it helps.
 
Kind regards,
Illia

Please login or Register to Submit Answer