反馈已提交

网络繁忙

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

PERIOD_ANLS

  • 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 that the "period end" value and the value of "last month end" can be displayed, as shown in the figure below:

    1.3 Implementation ideas

    Use the PERIOD_ANLS function.

    2. Concept

    Grammarperiod_anls(x_agg(array), datepart)The calculation at the end of the previous period is performed based on the date field added by the horizontal and vertical axis or the row and column dimensions.
    Parameter1x_agg(array)

    The first parameter is the indicator used for calculation, which must be an aggregate function or aggregate indicator.

    Parameter2datepartThe second parameter is used to configure the calculation of the end of the previous period as the end of the previous year or the end of the previous month. 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.

    Note 1: 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. 

    Note 2: The parameters support Y, M, W, and are not case sensitive.

    3. Examples

    Sample data: "Sales DEMO> FRDemo_ORDERS".

    3.1 Calculate the amount at the end of the previous year

    To calculate the amount at the end of the previous year, you need to change the grouping of the date field "SIGNDATE" to "Year Month", as shown in the figure below:

    6.png

    Add a new calculation indicator, named the "period end", and enter the formula: period_anls(SUM_AGG(contract amount), "Y"), as shown in the figure below:

    7.png

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

    Drag the calculation indicator "period end" into the indicator column, so the corresponding "period end" data for 2009 is the order amount of 2008-12. For details, please refer to section 1.1 of this article.

    3.2 Calculate the amount at the end of the previous month

    To calculate the ending amount of the last month, you need to change the grouping of the date field "SIGNDATE" to "Year Month Day", as shown in the following figure:

    8.png

    Add a new calculation indicator, named the "last month end", and enter the formula as: period_anls(SUM_AGG(AMOUNT), "M"), as shown in the figure below:

    9.png

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

    Drag the calculation indicator "last month end" into the indicator column, so the final data corresponding to July 2008 is the "AMOUNT" on June 30, 2008. See Section 1.2 of this article for the effect.

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