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

Count raw of straight table.

Hello all

I need help with a faster way to count raw of a straight table.

Today I have 16 straight tables in my model.

For each one their is a text box with the count of the raw's of the table.

Today I am using this macro for each one (16 times):

Sub NoofRowsCH01

set table = ActiveDocument.GetSheetObject("CH01")

  rows =  table.GetRowCount - 1

  ActiveDocument.Variables("vNoRowCH01").SetContent rows, True 

End Sub

I've 16 variables that contain the numbers and I show them in the text box.

In Document Event Triggers > OnPostReload I'm running all the macros.

So when I reload the model all my text box are update.

In this way the model takes a long time to refresh.

I'm searching a faster way to do this.

Any idea anyone?

BR

Ariel

5 Replies
Gysbert_Wassenaar

In general you can use something like this: count(aggr(1, dim1, dim2, ... , dimN) where dim1, dim2... etc are the dimensions of the chart.

If you use set modifiers in your expressions you may have to add the same modifiers to the count expression so the same filters are applied. Using dimension limits will also throw the count. And Suppress When Value is Null for dimensions can do that too.


talk is cheap, supply exceeds demand
ariel_klien
Specialist
Specialist
Author

Hi,

Thanks for your answer,

But I tried this before the macro and it took longer then the macro.

I'm searching for something quicker.

BR

Ariel

ariel_klien
Specialist
Specialist
Author

Hi,

any idea anybody?

Ariel

ariel_klien
Specialist
Specialist
Author

Hi all,

I still have this problem.

I  thought about another solution but  I need help with the macro.

I want this macro to insert the variable the value '1'  if in the table there is a 1 raw or more else '0'. (with out counting all the raw's in the table)

Any idea how to change the macro?

BR

Ariel

ariel_klien
Specialist
Specialist
Author

Hi,

any idea anybody?

Ariel