Notification

This article is about Looker Studio. For Looker documentation, visit https://cloud.google.com/looker/docs/intro.

Trang bạn đã yêu cầu hiện không có sẵn bằng ngôn ngữ của bạn. Bạn có thể chọn ngôn ngữ khác ở cuối trang hoặc dịch nhanh mọi trang web sang ngôn ngữ mà bạn chọn bằng cách sử dụng tính năng dịch được tích hợp sẵn trong Google Chrome.

AVG

Returns the average value of a set of numbers.

The AVG function calculates the average value of a numeric field.

In this article:

Syntax

AVG(value)

Parameters

  • value - a field or expression that evaluates to an unaggregated number.

How the AVG function works

The AVG function takes 1 parameter, which must be the name of a numeric field, or a numeric expression. AVG returns the average for all values of that field or expression.

You can't apply this function to a pre-aggregated field (Aggregation equals Auto), or to an expression which is the result of another aggregation function. For example, a formula such as AVG(SUM(x)) will produce an error.

There are 2 other ways to apply this function:

Examples

In these examples, the parameters passed to AVG are unaggregated numeric dimensions (i.e., they have an Aggregation type of None).

Example formula Input Output
AVG(Latency)
  • 0.02
  • 0.07
  • 0.09
0.06
AVG(CASE WHEN My Dimension < 1 THEN .5 WHEN My Dimension >= 1 AND My Dimension < 5 THEN 1 ELSE 2 END)
  • 0
  • 0.5
  • 3
  • 5
1

Thông tin này có hữu ích không?

Chúng tôi có thể cải thiện trang này bằng cách nào?
true
What's new in Looker Studio?

Learn about new features and recent changes. Looker Studio release notes live on Google Cloud.

Search
Clear search
Close search
Main menu
12194042978344902591
true
Tìm kiếm trong Trung tâm trợ giúp
true
true
true
true
true
102097
false
false