Custom Parameter (Static Parameter)

  • Last update: November 04, 2024
  • Overview

    Version

    FineDataLink Version

    Functional Change

    1.7

    Allowed customizing and configuring parameters.

    2.0

    Allowed defining parameters with the same values. A prompt would appear. For details, see section "Custom Constant Parameter."

    4.0.19

    Modified the supported types of custom parameters from Date, String, Integer, Double, and Boolean to Date, Text, Value, and Boolean.

    4.0.24

    Supported the yy parameter.

    4.1.0

    Modified Parameter Setting to Parameter List, which included in-task, global, and built-in parameters. Allowed viewing the available parameters of the task on the Parameter List page.

    Application Scenario

    In the business process, sometimes you need to configure parameters according to the actual business situation to facilitate subsequent data processing and development. FineDataLink allows you to customize parameters, which can be directly referenced in Data Development.

    Function Description

    You can add task parameters (namely, custom parameters) on the Parameter List page. The defined parameters can be referenced in the current task, as shown in the following figure.

    Notes

    • The ${} symbol is not allowed in parameter names and values.

    • The task parameters you added belong only to the current task.

    • If the parameter is of integer, double, or Boolean type, reference the parameter directly using ${Parameter name}.

    • If the parameter value is of character or date type, it must be enclosed in single quotes ('') in the form of '${Parameter name}'.

    Custom Time Parameter

    Customize a time parameter by increasing or decreasing the value of the built-in parameter ${cyctime} in a format of ${Time format + N} or ${Time format - N}.

    You can flexibly combine yyyy, yy, mm, dd, hh, mi, and ss to form the time format such as yyyy, mm, dd, yyyymm, mmdd, yyyymmdd, yyyy-mm-dd, and yyyy-mm-dd hh:mi:ss.

    iconNote:

    The following parameter formats are not supported: mi:ss, mi, and ss.



    Time Format

    Description

    yyyy

    Obtain the four-digit year from the ${cyctime} value.

    mm

    Obtain the month from the ${cyctime} value.

    dd

    Obtain the day from the ${cyctime} value.

    hh

    Obtain the hour (in the 24-hour time format) from the ${cyctime} value.

    mi

    Obtain the minute from the ${cyctime} value.

    ss

    Obtain the second from the ${cyctime} value.


    For example, you can use yyyy-2 to customize a time parameter para_time, whose value defaults to the year two years before the year in the ${cyctime} value, as shown in the following figure.

    iconNote:
    The parameter is of the Date type by default.


    Purpose

    Input Method

    Example (assuming the value of ${cyctime} is 2021-09-09 20:45:50)

    N year(s) later

    yyyy + N

    If N equals 1, the final value is 2022.

    N year(s) earlier

    yyyy - N

    If N equals 1, the final value is 2020.

    N month(s) later

    yyyymm + N or yyyy/mm + N

    If N equals 6, the final value is 202203.

    N month(s) earlier

    yyyymm - N or yyyy/mm - N

    If N equals 6, the final value is 202103.

    N week(s) later

    yyyymmdd + 7 * N or yyyy/mm/dd + 7 * N

    If N equals 1, the final value is 20210916.

    N week(s) earlier

    yyyymmdd - 7 * N or yyyy/mm/dd - 7 * N

    If N equals 1, the final value is 20210902.

    N day(s) later

    yyyymmdd + N or yyyy/mm/dd + N

    If N equals 1, the final value is 20210910.

    N day(s) earlier

    yyyymmdd - N or yyyy/mm/dd - N

    If N equals 1, the final value is 20210908.

    N hour(s) earlier

    yyyymmdd hh:mi:ss - N/24 or yyyy/mm/dd hh:mi:ss - N/24

    If N equals 1, the final value is 20210909 19:45:50.

    N hour(s) later

    yyyymmdd hh:mi:ss + N/24 or yyyy/mm/dd hh:mi:ss + N/24

    If N equals 1, the final value is 20210909 21:45:50.

    N minute(s) earlier

    yyyy-mm-dd hh:mi:ss - N/24/60

    If N equals 5, the final value is 20210909 20:40:50.

    N minute(s) later

    yyyy-mm-dd hh:mi:ss + N/24/60

    If N equals 5, the final value is 20210909 20:50:50.

    N second(s) earlier

    yyyy-mm-dd hh:mi:ss - N/24/60/60

    If N equals 5, the final value is 2021-09-09 20:45:45.

    N hour(s) earlier (to display hours, minutes, and seconds only)

    hh:mi:ss - N/24

    Assume that the current time is 17:21:43.

    If N equals 3, the final value is 14:21:43.

    N hour(s) later (to display hours, minutes, and seconds only)

    hh:mi:ss + N/24

    Assume that the current time is 17:21:43.

    If N equals 3, the final value is 22:21:43.

    N minute(s) earlier (to display hours, minutes, and seconds only)

    hh:mi:ss - N/24/60

    Assume that the current time is 17:21:43.

    If N equals 5, the final value is 17:16:43.

    N minute(s) later (to display hours, minutes, and seconds only)

    hh:mi:ss + N/24/60

    Assume that the current time is 17:21:43.

    If N equals 5, the final value is 17:26:43.

    N second(s) earlier (to display hours, minutes, and seconds only)

    hh:mi:ss - N/24/60/60

    Assume that the current time is 17:21:43.

    If N equals 5, the final value is 17:21:38.

    A simple example of defining a time parameter is as follows:

    1. Create an ETL task, and customize a para_time parameter with a default value of yyyy-mm-1 (the month before the value of ${cyctime}), as shown in the following figure.

    iconNote:

    Set the format of the parameter value consistent with that of the time field in the SQL statement. For example, if the value of the date field (to be used in SQL queries) is in the format of yyyy-mm-dd, the format of the parameter value should be set to yyyy-mm-1, instead of yyyy/mm-1..

    2. Drag a Data Synchronization node to the design page, configure the data source, and enter SQL statements to fetch data with values of the Ordertime field earlier than the value of the para_time parameter.

    3. Click Data Preview. The data where the Ordertime field value is at least one month earlier than the execution time has been fetched, as shown in the following figure.

    Custom Constant Parameter

    In addition to customizing time parameters, you can also customize constant parameters, which can be numbers or text.

    The following constant parameter types are supported: Text, Value, and Boolean.

    The following is an example of defining constant parameters.

    1. Create a scheduled task, and define a text-type parameter para_a whose value defaults to Sales Manager and Sales Representative. Separate parameter values by comma (,), as shown in the following figure.

    2. You can use this parameter for SQL queries in other nodes. For example, you can use it in the Data Synchronization node to fetch data where the value of the Position field is Sales Manager or Sales Representative, as shown in the following figure.

    3. Click Data Preview to view the fetched data. 

    When the parameter type is Text, pay attention that:

    • If the parameter includes a single value, enter the text directly in the Parameter Value bar. Enclose the parameter in single quotes (for example, '${a}') when using it.

    • If the parameter includes multiple values, enclose each value in single quotes and separate values by comma (for example, 'apple','banana'). You do not need to add single quotes ('') when using the parameter.

    附件列表


    主题: Data Development - Scheduled Task
    Previous
    Next
    • 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