Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

9 Replies
srchilukoori
Specialist
Specialist

check the attached qvw.

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

israrkhan
Specialist II
Specialist II

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

Not applicable
Author

thanks, IsrarKhan,

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

srchilukoori
Specialist
Specialist

did you see my app from my previous post.

time interval.PNG.png

Is this what you are trying to implement?

Not applicable
Author

yes

Anonymous
Not applicable
Author

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

Not applicable
Author

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

Anonymous
Not applicable
Author

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

Not applicable
Author

thanks. didnt think of this approach.