Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

No. of lines in a certain table (no. of rows)

I have a straight table in one of the sheet. The straight table consist of 2 dimensions and 2 expressions. Each expressions has pretty long formula.

I created a summary sheet; intending to show the number of record found in the table mention earlier.

Originally, I use function "count" and try to combine the formula of the 2 expressions. It works but not all time. If I load the qlikview with different data set, the count does not always return the same number of lines in the straight table.

I wonder if there is any function that I can use to get the number of lines of a certain object in a qlikview?

Thanks.

Pound.

13 Replies
Not applicable
Author

Thank you John and Michael.

I marked both your replies as "answer"

For those searching the same thing.

1. Create a variable. From menu -> Settings -> Document settings -> Variable tab. Just add and give it any name. For my macro, the variable name is "myVar"

2. Select the macro type and click on Edit Module

3. Enter macro like this


poundesville wrote:

Sub NoOfRows
set chart = ActiveDocument.GetSheetObject("CH77")
ActiveDocument.Variables("myVar").SetContent chart.GetNoOfRows, true
end Sub


4. On Macro page. on Document Event Trigger choose "OnAnySelect" and choose the macro "NoOrRows" that you just created in step 3
5. Now you can use "myVar" anywhere in your qlikview.

Anonymous
Not applicable
Author

Tried this macro and it doesnt work for me. I get a message the the object does not support the property. I looked in the api guide and i dont see and GetNoOfRows associated with charts. Hmm.

Anonymous
Not applicable
Author

Tim,
Waht type of chart is it? GetNoOfRows exists for straight table only.
(Unless it is different depending on QV version as well)

christian77
Partner - Specialist
Partner - Specialist

Hi:

rowno() gives you the number of the row you are.

If you have more than 1 dimension, it initializes every change of dimension. Use then rowno(Total) and youll have the rowno without considering dimensions.

It works the same for columnno(), columnno(Total). Very useful to inter record calculations like accumulating any column or row together with rangesum and range any function.