反馈已提交

网络繁忙

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

Calculate the cumulative average

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

    1.1 Problem description

    When using FineBI, it is sometimes necessary to find the cumulative average by dimension, such as January 2020 for the average number of products purchased in January, February 2020 for the cumulative average number of purchases in January and February, and March 2020 for the cumulative average number of purchases in January, February, and March.

    For example, find the cumulative average of the number of sales based on the date (month of the year) as follows.

    23.png

    1.2 Implementation idea

    • The cumulative value of the number of sales by month and year.

    • Calculates the current cumulative number of years and months corresponding to the year and month.

    • The cumulative value of the number of sales / the current cumulative number of years and months, and calculate the cumulative average value of the corresponding years and months.

    2. Operation idea

    Example data: Built-in data>Group Merchandise Sales Summary

    2.1 Find the cumulative sales quantity

    1)Create "Dashboard > Grouped Tables", select the Group Merchandise Sales Summary table, drag the "Date" field into the dimension column, drag the "Quantity" field into the indicator column, and switch the month and year display for the "Date" field, as shown in the following figure.

    24.png

    2)Click Add calculation indicator, here you need to calculate the cumulative value of sales for the current month's sales and the cumulative value of sales before the current month, enter the formula: ACC_SUM(SUM_AGG(Quantity),0), as shown below.

    25.png

    Note: The "Quantity" field needs to be selected from the field column on the left and cannot be entered manually.

    Formula Description.

    The ACC_SUM function represents the calculation of the accumulation of metrics across rows based on fields added to the horizontal and vertical axes or row and column dimensions.ACC_SUM(SUM_AGG(Quantity),0), In other words, you can calculate "Quantity" by year and month, and then calculate the cumulative value.

    Drag the "Cumulative Sales Quantity" into the indicator column, as shown in the figure below.

    26.png

    2.2 Calculate the  cumulative years-months

    In order to find the average cumulative sales, so you also need to calculate the current cumulative number of years and months. Click on the add calculation indicator, and the cumulative number of years and months is calculated as follows: RANK_ANLS(cumulative sales quantity,0,"asc"), as shown in the figure below.

    27.png

    Formula Description.

    RANK_ANLS according to the horizontal and vertical axes or row dimension added to the fields of the indicator for the calculation of cross-row ranking, in fact, in order to seek the cumulative number of years and months and borrow the sorting function to sort the cumulative sales volume to get the required data.

    Drag and drop it to the indicator column of the table, as shown in the following figure.

    28.png

    2.3 Calculate the cumulative average the corresponding year and month

    Once you have the cumulative value of the number of sales and the cumulative value of the year and month, you can divide them to find the cumulative average value of the corresponding year and month.

    Click on the add calculation indicator and use the cumulative value of purchased purchased products/line directly, as shown in the figure below.

    Note: Both data have to be selected from the left field column and cannot be entered manually.

    29.png

    Drag the field into the indicator column of the form, as shown below.

    30.png

    2.4 Effect view

    See Section 1.1 of this document for details.

    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后关闭