Calculating the YOY Ratio of Monthly Accumulated Sales

  • Last update:  2023-04-19
  • Overview

    Background

    You can use the quick calculation function in FineBI to calculate the accumulated sales by a given month every year if you do not use the DEF function.

    In the daily work, the YOY ratio of monthly accumulated sales is often needed, but it cannot be generated by the quick calculation function. Therefore, you need to use the DEF function.

    Preview

    Calculate the YOY ratio of accumulated sales by a given month.

    In the table, you can see that the accumulated sales by June in 2013 was 116,57 thousand, while as of June in 2014, the accumulated sales was 1,385.5 thousand, up by 18.86% year-on-year.

    Procedures

    Adding Data

    Sample data: Supermarket Sales Data.xlsx

    Create a subject and upload the sample data.

     QQ图片20230410165158.png

    Processing Data

    You want to calculate the accumulated sales by a given month, so it's necessary to extract fields Month and Year during the data processing to sort months in the ascending order.

    1. Click Get time to get the year of the order date.

     QQ图片20230412143700.png

    QQ图片20230412143714.png

    2. Click Get time to get the month of the order date.

     

    3. Click Save and Update.

    Creating Components

    The expected effect is shown below:

     QQ图片20230412152921.png

    1. Calculating the Monthly Accumulated Sales

    Add a calculation indicator to calculate the accumulated sales by a given month. The filter condition is Year=EARLIER(Year), Month<=EARLIER(Month).

    For example, the generated result of sales in March in 2014 would be the sum of sales in January, February and March.

     QQ图片20230412152621.png

    Formula

    Description

    Help Document

    SUM-AGG (Sales Volume)

    Calculate the profit   sum

    SUM-AGG

    DEF_ADD(SUM-AGG(Sales   Volume),[],[Year-EARLIER(Year),Month<=EARLIER(Month)])

    Calculate the accumulated sales by a given month every year.

    • Specified dimension: No.

    • Dimensions for analysis: Year and Month.

    • Filter condition: Year=EARLIER(Year), Month<=EARLIER(Month).

    DEF_ADD

     

    2. Calculating the Accumulated Sales for the Same Period Last Year

    Filter condition: Year=EARLIER(Year-1), Month<=EARLIER(Month).

     QQ图片20230412152617.png

    Formula

    Description

    Help Document

    DEF_ADD(SUM-AGG(Sales   Volume),[],[Year-EARLIER(Year),Month<=EARLIER(Month)])

    Calculate the monthly accumulated sales last year.

    • Specified dimension: No.

    • Dimensions for analysis: Year and Month.

    • Filter condition: Year=EARLIER(Year-1), Month<=EARLIER(Month).

    DEF_ADD

     

    3. Calculating the YOY Ratio

    Formula: YOY ratio=(monthly accumulated sales/monthly accumulated sales last year-1)*100% .

     QQ图片20230412152624.png

    Formula

    Description

    Help Document

    Monthly accumulated sales/monthly accumulated sales last year-1

    Calculate the YOY ratio

    /

    IF(ISNULL(Monthly   Accumulated Sales Last Month),"",Monthly Accumulated Sales/Monthly   Accumulated Sales Last Year-1)

    If the value of Monthly Accumulated Sales Last Year is null, no result will be displayed. Otherwise the YOY ratio will be displayed.

    IF

    4. Creating Group Table

    Set the chart type as Group Table, and drag fields into the corresponding columns for analysis. Set the first Time of Order field as year, and the second as Month.

    You can change the number format of all those sales-related fields into Ten Thousand, and the number format of the YOY Ratio field into Percentage.

    QQ图片20230412151618.png

    Effect Display

    For details, see section "Preview".

    附件列表


    主题: Felicity 待翻译
    • 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