Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
moleroalonso
Contributor II
Contributor II

Calculate average grouping by continuous values

Hi,

I have a graph table and I need calculate a column on  a special way: the values are the average of the values of a previous column called (Diff) grouped by the continuous values of other column (Duration), See an example at the image below:

caculateAVGgroup.png


Currently I am calculating the "Avg. diff" column with this expression:

avg(aggr(

     avg(Duracion- (Aggr(Avg(duracionReal), F30_HRAsignada) + TiempoEspera)) /*Calculation of "diff" Column*/

, Duration))

The result is this but it is not the expected result

caculateAVGgroup2.png

I tried it using a calculated dimesion but calculated dimesion are not valied in AGGR functions.

¿Any idea?

Best regards,

José María

1 Solution

Accepted Solutions
moleroalonso
Contributor II
Contributor II
Author

Hi,

I finally fixed this problem in the Load Script. I calculated a new field that mark each  continuos values with a ID.

The thread can be closed.

Thank very much!

View solution in original post

2 Replies
sunny_talwar

Would you be able to share your application to play around with this? It is difficult to suggest anything without being able to see how the data structure looks like and without trial and erroring it

moleroalonso
Contributor II
Contributor II
Author

Hi,

I finally fixed this problem in the Load Script. I calculated a new field that mark each  continuos values with a ID.

The thread can be closed.

Thank very much!