Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I would like to know if there is any function I can use to find the number of rows of a chart object. that is, when a specific selection is made, I want to get the row count of a straing table chart in a text box. I was trying out with nowofrows() function, but I was not able to get to the solution I was checking. Please give me some inputs for the same.
Thanks for all the help in advance.
Thanks and Regards
Joseph
Hi Joseph,
using macro to count all the rows will work with any table but the macro must be triggered somehow (button,selection etc.) Using expression calculation in textbox also can give you the number. Can you provede a sample qvw file?
Thanks!
Stefan
Hi,
Try below macro to achive what you want.
Sub Get_Row
set chart = ActiveDocument.Sheets("Main").CreateStraightTable
chart.AddDimension "Class"
chart.AddDimension "Member"
chart.AddExpression "only(MemberComment)"
msgbox("number of class members = "&chart.GetNoOfRows)
End sub
Go to module and paste this.
Note: Change the dimension and expression as per your data.
Regards,
Kaushik Solanki
HI,
This is a kinda workaround if you dont want to use macro/any other code in your application. PFA.
This is just copy of actual table andhidden all all column but Total Rows.
Number of rows in a chart could be tricky, as for the other answers.
However, if the real question is not about the number of rows, but about the count of dimension values, you're probably better set with a simple expression in the text object, something like:
=$(=Count(Distinct Dimension1 & '_' & Dimension2 & '_' & Dimension3))
I hope I can get you the idea.
Good luck!