MAX_AGG - Returning the Maximum Value of a Field

  • Last update:December 26, 2024
  • Overview

    SyntaxMAX_AGG(Array)According to the current analysis dimension, this function returns the maximum value of the field. The generated results are listed in a data column. The number of rows in the data column is consistent with that in the current analysis dimension.

    Parameter

    Array

    The Array parameter must be the result returned by a non-aggregate function formula, which can be a calculation result of an indicator field, dimension or indicator field and a common formula. When the Array parameter is a non-numeric field, it can be used only in the DEF function.

    Notes

    • The function supports one parameter of any type for real-time data.

    • The function is only supported on the dashboard and not supported for self-service datasets.

    Example

    If the horizontal axis is the dimension field Day, the value returned by the calculation field MAX_AGG(Sales Volume) of the vertical axis is the maximum daily sales.

    If the horizontal axis is the dimension field Month, the value returned by MAX_AGG (Sales Volume) is the maximum monthly sales.

    Calculating the Maximum Time in the Current Dimension

    You need to calculate the maximum time in the current dimension, for example, the maximum time in the monthly data in Contract Signing Time, as shown in the following figure.

    Click , set Field Name to Maximum Time, and enter FORMAT(TODATE(MAX_AGG(DATETONUMBER(Contract Signing Time))),"YYYY-MM-dd HH:mm:ss"), as shown in the following figure.

    The following table describes the formula.

    Formula
    Description

    DATETONUMBER(Contract Signing Time)

    Returns the number of milliseconds from January 1, 1970 00:00:00 GMT to the specified date.

    MAX_AGG(DATETONUMBER(Contract Signing Time))

    Returns the maximumnumber of milliseconds in the current dimension. (The returned value is of   the numeric type.)

    TODATE(MAX_AGG(DATETONUMBER(Contract   Signing Time)))

    Converts the maximum number of milliseconds in the current dimension to a specified date.

    FORMAT(TODATE(MAX_AGG(DATETONUMBER(Contract Signing Time))),"yyyy-MM-dd hh:mm:ss")

    Converts the maximum date (the value returned by TODATE(MAX_AGG(DATETONUMBER(Contract Signing Time)))) in the current dimension to the format yyyy-MM-dd hh:mm:ss.

    Drag the Contract Signing Time field into the horizontal axis, group the field by Year-Month, and drag Maximum Time into the horizontal axis, as shown in the following figure.

    附件列表


    主题: Advanced Data Analysis
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy