Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
fredericvillemi
Creator III
Creator III

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

5 Replies
fredericvillemi
Creator III
Creator III
Author

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 ?

whiteline
Master II
Master II

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))

fredericvillemi
Creator III
Creator III
Author

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

whiteline
Master II
Master II

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

Use your expression instead of just '1', for example:

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

Not applicable

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"))