9 Replies Latest reply: Sep 30, 2013 3:45 PM by Mg Mg

# How to average an expression column?

Hi,

my straight table consist of 2 columns: TIME as dimension, expression: [TIME]-above[TIME] to get the interval between each row.

for example:

time               interval

00:01:00          00:00:00

00:02:30          00:01:30

etc..

i am looking for a solution to be able to average the Interval column, i have tried by adding expression: avg(interval), but i get in each row of this 3rd column: '-'.

can someone assist?

thanks.

Moti

• ###### Re: How to average an expression column?

check the attached qvw.

Under the expressions tab of the straight table properties, in the totals section.

• ###### Re: How to average an expression column?

try =avg(column(3)), if it is third column.

• ###### Re: How to average an expression column?

thanks, IsrarKhan,

i have tried this but didnt work. got '-' in each row of this expression.

• ###### Re: How to average an expression column?

did you see my app from my previous post.

Is this what you are trying to implement?

• ###### Re: How to average an expression column?

yes

• ###### Re: How to average an expression column?

thanks. didnt think of this approach.

• ###### Re: How to average an expression column?

Hi Moti,

I do not know if I got it right, but to have the avg of the interval, use:

Time((  RangeSum( Above( Sum( Time ), 1, RowNo() ) ) + Time ) / RowNo(), 'hh:mm:ss' )

See Attached.

Regards

• ###### Re: How to average an expression column?

thanks, but i can not see any attached nor send my qvd

• ###### Re: How to average an expression column?

Well, basically there are 2 averages:

With the current row included:

Time((  RangeSum( Above( Sum( Time ), 1, RowNo() ) ) + Time ) / RowNo(), 'hh:mm:ss' )

Without the current row included:

Time((  RangeSum( Above( Sum( Time ), 1, (RowNo()-1) ) )  ) / ( RowNo() - 1 ) , 'hh:mm:ss' )