反馈已提交

网络繁忙

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

A date is within a specified time period

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

    1.1 Expected Effect

    Users sometimes need to determine whether a time field is within a specified time period, for example, whether "Invoice Time" is between "Account Entry Time" and "Shipment Time", as shown in the following figure:

    结果.png

    1.2 Implementation Ideas

    Use the statement IF, AND and DATEDIF.

    Calculate the time difference between "Shipment Time" and "Account Entry Time", "Invoice time" and "Account Entry Time", "Shipment Time" and "Invoice Time" respectively.

    Using if judgment, if the time difference between "Shipment Time" and "Account Entry Time" is greater than the other two time differences at the same time, the "Invoice Time" is between "Account Entry Time" and "Shipment Time".

    2. How To Do It

    Example data:Time-Judgment.xlsx

    Upload this Excel dataset to FineBI, as shown in the following figure:

    操作步骤.png

    2.1 Create a Dataset

    Add a dataset, and select an Excel dataset, and check all fields, as shown in the following image:

    创建自助数据集.png

    2.2 Judge the Time

    Click on the button to add "New column", as shown in the following figure:

    判断时间1.png

    Name the new column as "Judging Results", enter the formula:

    IF(AND(DATEDIF(${Account Entry Time},${Shipment Time},"D")>(DATEDIF(${Invoice Time},${Shipment Time},"D")),DATEDIF(${Account Entry Time},${Shipment Time},"D")>DATEDIF(${Invoice Time},${Account Entry Time},"D")),"Yes","No")

    then click OK, as shown in the following figure:

    判断结果的公式.png

    Note: the functions and fields in the formula box need to be selected by clicking the selection area on the left, and cannot be entered manually.

    Formula explanation:

    Formulaexplanation
    DATEDIF(${Account Entry Time,"D")The formula calculates the number of days of time difference between "Account Entry Time" and "Shipment Time".
    AND(DATEDIF(${Account Entry Time},${Shipment Time},"D")>(DATEDIF(${Invoice Time},${Shipment Time},"D"))If the time difference between Shipment Time and Account Entry Time is greater than the other two days at the same time, return true; otherwise, return false.
    IF(AND(DATEDIF(${Account Entry Time},${Shipment Time},"D")>(DATEDIF(${Invoice Time},${Shipment Time},"D")),DATEDIF(${Account Entry Time},${Shipment Time},"D")>DATEDIF(${Invoice Time},${Account Entry Time},"D")),"Yes","No")If true, "yes" is output; otherwise, "no" is output.

    2.3 View the Effect

    See Section 1.1 of this document for details.

    Attachment List


    Theme: Data Processing
    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后关闭