Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

number of rows in a straight table_ urgent


Hello Community,

I have a straight table with 9 dimensions and four expressions column.

Out of the 9 dimensions, 3 are calculated dimensions.

I wrote a macro:

sub temp

set obj = ActiveDocument.GetSheetObject("CH873")

ActiveDocument.Variables("vNoOfRows").SetContent obj.GetRowCount, true

end sub

This macro is giving me the current row count.

But my user does not permit the use of macros, hence I will have to write expressions in a text box to display the number or rows.

The expression I wrote is:

count(distinct(dim1 & dim2 & calculated dim 3 & calculated dim 4 & dim 5 & dim 6 & dim 7 & calculated dim 8 & dim 9))

This is not giving me a correct value.

Kindly help me write an expression for the same purpose

Regards,

Vishal

20 Replies
Not applicable
Author

Also can you explain me how does this count(dim 1&  dim 2 etc.) i.e count of multiple dimensions work?


Not applicable
Author

  Use this one

=Count(Dim1)+Count(Calcuted dim1) and go on....

Not applicable
Author

I am afraid this is not giving me the correct result. In fact the value is far from being close to the actual number.

Also your expression counts the number of entries for each dimension separately. Hence I assume this is not the correct approach.

Not applicable
Author

Hi Vishal,

Counting the dimension may not give you the row count. Say for example, if certain combination of dimension return zero value to all your four expressions then those dimension row will not appear in your straight table, but in the count of dimension system will consider it.

Not applicable
Author

Not sure whether the below expression helps you, just give a try

= Count(Aggr(Sum(expression), Dim1, dim2,..))

Not applicable
Author

Hello Gowri,

I think you are right. This is not the right approach. I will try the expression suggested by you.

Not applicable
Author

Did you try the function NoOfRows with the total argument ?

NoOfRows(total) returns for a line of the report the total number of lines of the report.

Fabrice

Not applicable
Author

Yeah I did! Unfortunately it returned 1

Not applicable
Author

With the total qualifier ? => NoOfRows(total)

the help says " Returns the number of rows in the current column segment in a table or, in the case of bitmap charts, in the chart's straight table equivalent.

If the chart is one-dimensional or if the qualifier total is used as argument, the current column segment is always equal to the entire column. "

It always worked fine for me.

Fabrice