Get day gap based on month

  • Last update:  2021-06-10
  • I. Overview

    When different times are obtained through the parameter widget, if you want to obtain the day gap between the two dates. How to achieve it? As shown below:

    Enter the start month and end month, and calculate the gap in the cell.

    1.gif

    II. Application

    1. Parameter pane

    Add two "Text Field" widgets, two "Date" widgets, and one "Query" button in the parameter pane. As shown below:

    2.png

    Set the widget setting respectively. As shown in the figure below:

    3.png


    2. Report style

    Set the report style and insert formulas in the cells. As shown below:

    4.png

    A2: $Start_month

    B2: $End_month

    C2: DATE(LEFT($Start_month, 4), RIGHT($Start_month, 2), 01)

    D2: DATEINMONTH(DATE(LEFT($End_month, 4), RIGHT($End_month, 2), 01), -1)

    E2: DATEDIF(DATE(LEFT($Start_month, 4), RIGHT($Start_month, 2), 01), DATEINMONTH(DATE(LEFT($End_month, 4), RIGHT($End_month, 2), 01), -1), 'D')

    Note: DATEDIF takes the time, only one day is calculated at the beginning of the month and the end of the month. If you want to calculate both head and tail, just use the formula +1 in cell E.


    3. Preview effect

    Save the template, click pagination preview, the effect is shown in I.

    Note: Both App and HTML5 are supported.

    III. Download template

    Completed template, please refer to: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Parameter\Get_day_gap.cpt

    Click to download: Get_day_gap.cpt

    Attachment List


    Theme: Parameter
    Already the First
    • 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