反馈已提交

网络繁忙

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

PREVIOUS_PERIOD

  • Recent Updates: May 10, 2022
  • 1. Overview

    1.1 Version

    FineBI VersionJAR PackageFunction Changes
    5.1-
    -
    5.1.72020-11-05Function definition optimization & specify the validity of function parameters

    1.2 Expected effect

    It is hoped to realize the display of the "circular period" value. For example, the value of the period in June 2008 will be displayed in the previous month: the order amount in May 2008, as shown in the figure below:

    13.png

    1.3 Implementation ideas

    Use the PREVIOUS_PERIOD function.

    2. Concept

    Grammarprevious_period(x_agg(array))Calculate the circular period value based on the date field added in the horizontal and vertical axis or row and column dimensions.
    Parameterx_agg(array)

    The parameter is the indicator used for calculation, and the indicator must be an aggregate function or aggregate indicator. When the field dragged on the horizontal and vertical axis does not meet the calculation requirements of the function, the indicator will be marked in red.

    3. Example

    previous_period(sum_agg(AMOUNT)): the "SIGNDATE" dragged by the user on the horizontal and vertical axis ("Year Month Day" grouping), then the calculation result of this indicator is that the "AMOUNT" is grouped and summarized according to the "Year Month Day", and then the data for the last day's amount is calculated. 

    Sample data: "Sales DEMO>FRDemo_ORDERS". 

    3.1 Calculate the monthly circular period amount 

    To calculate the "monthly circular period" amount, you need to change the grouping of the date indicator "SIGNDATE" to "Year Month", as shown in the following figure:

    14.png

    Add a new calculation indicator named "circular period", enter the formula: PREVIOUS_PERIOD(SUM_AGG(AMOUNT)), as shown in the figure below:

    15.png

    For the writing of functions, please refer to: Function Calculation Format.

    3.2 Effect view

    You can drag the calculation indicator into the indicator column, so the circular period value in June 2008 is the amount of the last month: May 2008. For details, see Section 1.2 of this article.

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