Pivot Calculated formula: SUM(Field1)/AVG(Field2)

前端 未结 3 1660
北荒
北荒 2020-12-16 18:30

I\'ve a simple table with some amount and interval in sec by date and product name.

Month | Product | Amount | Interval in sec
------------------------------         


        
3条回答
  •  眼角桃花
    2020-12-16 19:03

    In case anyone else comes across this problem, a solution that I've found is to add a helper "Count" column to your data set, where each record has a 1 entered under the "Count" field.

    Then, in order to achieve the effect of an Average, you can use:

    SUM(FIELD_TO_AVERAGE)/SUM(COUNT)

    I believe this should work in all cases where an average is needed, but I haven't tested it very broadly.

提交回复
热议问题