反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

Conditional summation and counting

  • Recent Updates: April 26, 2022
  • 1. Overview

    In Excel:

    "Condition count (COUNTIF/COUNTIFS)": count the number of data pieces that meet a certain condition.

    Conditional summation (SUMIF/SUMIFS): used to sum the values of specified conditions.

    In BI, you can also use combinatorial functions to realize conditional summation and counting.

    Note: cross data table calculation cannot be realized in BI, you can only calculate in one data table.

    2. Condition count

    Note: if you don't need de duplication statistics and only need to record the times, use COUNT_AGG count is enough.

    Example: calculate the number of users logged in on the activation date (de count the contact information of users logged in on the current day)

    Sample data:

    412.User retention analysis.xlsx

    2.1 Operation steps

    After uploading data, create a component, select the "User retention analysis" data set and enter the component editing interface.

    Create a calculation field and enter the field name and formula: COUNTD_AGG(IF(DATEDIF(${Earliest activation date},${Login time},"D")=0,${TEL},null)), then click "OK", as shown in the following figure:

    2021-08-18_16-12-38.png

    Formula description:

    FormulaDescription
    DATEDIF(${Earliest activation date},${Login time},"D")Calculate the time difference between the login time and the earliest activation time, and return the time difference in days
    IF(DATEDIF(${Earliest activation date},${Login time},"D")=0,${TEL},null) If the time difference = 0, i.e. log in on the activation date, the "TEL" of the user will be output; otherwise, null will be output, i.e. no counting will be performed
    COUNTD_AGG(IF(DATEDIF(${Earliest activation date},${Login time},"D")=0,${TEL},null))Decount the contact information of the login user on the current day

    2.2 View the effect

    Drag the "Earliest activation time" into the horizontal axis and set it as "Year Month". Drag the "Number of logged in users on the activation day" field into the vertical axis to see the number of logged in users on the activation day, as shown in the following figure:

    2021-08-18_16-27-44.png

    3. Conditional summation

    Example: calculate the total amount of "profit" with "area" as "Beijing", and "sales channel" as "supermarket".

    Sample data:

    316.AC-sales.xlsx

    3.1 Operation steps

    Create a dashboard, select the "AC-sales" dataset, create a "calculation indicator", and enter the field name and formula: SUM_AGG(IF(${area}="Beijing"&&${sales channel}="supermarket",${profit},0)), as shown in the following figure:

    2021-08-18_16-30-48.png

    Formula description:

    FormulaDescription
    (IF(${area}="Beijing"&&${sales channel}="supermarket",${profit},0) If the "area" is "Beijing", and "sales channel" is "supermarket", the "profit" is output; otherwise, 0 is output
    SUM_AGG(IF(${area}="Beijing"&&${sales channel}="supermarket",${profit},0))Sum the results of the previous step

    3.2 Effect view

    After saving the indicator, drag the "Beijing Supermarket Profit" indicator into the "indicator" field to see the total collection amount under the specified conditions, as shown in the figure below:

    2021-08-18_16-32-58.png

    Attachment List


    Theme: Advanced Data Analyis
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭