5 Replies Latest reply: Dec 3, 2012 3:42 PM by Tim Benoit

# Get the number of lines of a Straight Table Chart ?

Hi,

is there a way to get the number of lines of a Straight Table ?

Thanks

• ###### Re: Get the number of lines of a Straight Table Chart ?

What i would like to do is to show the number of lines on the caption of the straight table ... and without macro if possible .. it seems not possible ?

• ###### Re: Get the number of lines of a Straight Table Chart ?

Hi.

You could just use count(distinct Dim1) if you have one dimension in the straight table.

For more than one dimension, you could try to use a trick with aggr():

=Count(aggr(1, Dim1, Dim2, Dim3))

• ###### Re: Get the number of lines of a Straight Table Chart ?

I have ~10 dimensions .. and this trick doesn't seem to work, i have less lines than the result of your formula

• ###### Re: Get the number of lines of a Straight Table Chart ?

Then you just have zeros for some combinations and checkbox 'supress zero values' is on.

=Sum(aggr(if(Sum(Value)<>0, 1, 0), Dim1, Dim2, Dim3))

• ###### Re: Get the number of lines of a Straight Table Chart ?

I have done this many times in a calculation condition to limit the number of rows in a table that otherwise might require millions of rows and consume too much memory.

If you have three dimension fields then the calculation is like this: Sum( Aggr( 1, field1, field2, field3 ))

If any of the dimensions are a cycle group then, instead of a field name, use this:  \$(=GetCurrentField("mycyclegroup01"))