DEF_ADD (Analysis Area Dimension and Specified Dimension)

  • Last update:November 15, 2023
  • Overview

    DEF_ADD function calculates the value of the aggregate indicator based on the dimension specified by the function and in the analysis area.

    Compared to DEF function, DEF_ADD function involves the dimension in the analysis area, so adding or deleting the dimension affects the function result.

    Grammar

    DEF_ADD(Aggregate indicator,[Dimension1,Dimension2,...],[Filter condition1,Filter condition2,...])

    Perform calculations on indicator fields that meet the filter conditions based on the dimension specified by the function and in the analysis area.

    Parameter 1

    Aggregate indicator

    1. There must be one and only aggregate indicator in the function.

    2. The aggregate indicator supports nesting (output by any function).

    iconNote:
    If the aggregate indicator is a detailed filtered one, an error prompt pops up, saying Detailed filtered indicators only support aggregate functions.


    Parameter 2

    Specified dimension

    1. Dimension specified by the function

    2. If there is only one dimension parameter, the symbol [ ] can be omitted.

    Parameter 3

    Filter condition

    1. The filter condition can be empty, if so, the function performs the aggregate calculation on all fields of the indicator.

    2. The filter condition supports setting filter details and nesting indicators (output by DEF functions), but does not support aggregate functions.

    3. Multiple filter conditions are supported, and those of the same level are performed based on the AND relationship.

    4. If there is only one filter condition, the symbol [ ] can be omitted.

    5. If the specified dimension is empty, the function format is DEF_ADD(Aggregate indicator,[],[Filter condition 1,Filter condition 2,...]).



    iconNote:
    DEF_ADD does not output dimension fields.

    Examples

    The following table introduces the usage and role of DEF_ADD.

    Scenario
    FormulaDescription

    Drag the dimension field Province into the analysis area.

    1.png

    Sales of each province

    DEF_ADD(SUM_AGG(Sales), [])
     
     

    • Specified dimension: /

    • Analysis area dimension: Province

    • Aggregate indicator: SUM_AGG(Sales)

    Calculate the sales of each province.

    Sales of each client


    iconNote:
    For details, see section "Sales of each Client in Different Provinces".

    DEF_ADD(SUM_AGG(Sales),[Client's Name])

    • Specified dimension: Client's Name

    • Analysis area dimension: Province

    • Aggregate indicator: SUM_AGG(Sales)

    Calculate the sales of each client in different provinces.

    The above roles of DEF_ADD can all be achieved by DEF, which covers even more extensive needs.,

    Compared to DEF, DEF_ADD can adjust the dimension by dragging fields to quickly obtain various analysis results.

    For example, you can make changes to the above scenario to calculate the sales of each area and the sales of each client in different areas.

    To use DEF_ADD, you only need to change the dimension field in the analysis area from Province to Area.

    To use DEF, you need to change the formulas to DEF(SUM_ADD(Sales),[Area]) and DEF(SUM_ADD(Sales),[Area, Client's Name]).

    Analysis is a process of exploration that requires you to constantly change angles to discover new problems. DEF_ADD helps boost your analysis efficiency.


    Sales of Each Client in Different Provinces

    This section introduces how to calculate the sales of each client in different provinces and compares the sales of each client with the total.

    The effect is shown in the following figure.

    2.png

    1. Sample data: Supermarket Sales Data.xlsx

    Create a subject and upload the sample data, as shown in the following figure.

    3.png

    2. Add a calculation indicator to calculate the sales of each client.

    Since this analysis is based on the provincial dimension, you need to drag the Province field into the analysis area, as shown in the following figure.

    4.png

    Scenario
    FormulaDescription

    Sales of each client in different provinces

    DEF_ADD(SUM_AGG(Sales),[Client's Name])

    • Specified dimension: Client's Name

    • Analysis area dimension: Province

    • Aggregate indicator: SUM_AGG(Sales)

    Calculate the sales of each client in different provinces.

    3. Drag Sales of each Client into the analysis area and change the Summary Mode to Average. The result is shown in the following figure.

    【界面词改】5.png

    4. Drag Sales into the analysis area to compare the sales of each client with the total, as shown in the following figure.

    As you can see, Fujian Province has relatively high sales of each client in spite of its low total sales.

    6.png


    附件列表


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

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

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

    不再提示

    10s後關閉

    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