Variable classification and assignment
Dataphin supports several variable types. Learn how variables are classified and how to assign date and time values to local variables.
Variable classification description
Dataphin categorizes variables as follows:
|
Variable Type |
Description |
|
Global Variable |
Global variables are defined in Dataphin Planning- Common Business Logic-Global Variable and can be referenced in any node or code within the tenant. The built-in global variable is Note
|
|
Space Name Variable |
These include
Note
Space name variables cannot be converted into other variable types. |
|
Local Variable |
Local variables do not need to be declared in advance. Use
Variable names can contain only letters, digits, and underscores. Do not start a name with dp_glb_, which is reserved for global variables. The maximum length is 32 characters. Important
|
|
Cross-node Variable |
Cross-node variables are parameters passed from an ancestor node to the current node. Common scenarios include:
Important
|
Variable assignment description
Date and time calculation expression
Dataphin supports the following date calculation operators for assigning date and time values to local variables:
-
Date and time calculations support the following formats:
-
For business date
${bizdate}, use the format:${(yyyyMMdd|yyyy/MM/dd|yyyy-MM-dd) (+|-) n}. -
For the expected running time (the node task's start time), use:
$[(yyyyMMddHHmmss|yyyy/MM/dd HH:mm:ss|yyyy-MM-dd HH:mm:ss) (+|-) n].
-
-
Identifiers for date and time components:
-
Year: yyyy.
-
Month: mm for day-level granularity or MM for minute-level granularity (uppercase to differentiate from minute mm).
-
Day: dd.
-
Hour: HH.
-
Minute: mm.
-
Second: ss.
-
-
The base interval unit is one day:
-
Represent 1 hour as 1/24, 5 hours as 5/24.
-
Represent 1 minute as 1/1440 (1/24/60), 30 minutes as 30/1440.
-
Example reference
|
Current Date |
Configuration Based on Business Date (T-1) |
Actual Value |
Configuration Based on Expected Running Time (T) |
Actual Value |
|
2018-01-10 |
${yyyymmdd} |
20180109 |
$[yyyymmdd] |
20180110 |
|
2018-01-10 |
${yyyyMMdd} |
20180109 |
$[yyyyMMdd] |
20180110 |
|
2018-01-10 |
${yyyymmdd -1} |
20180108 |
$[yyyymmdd -1] |
20180109 |
|
2018-01-10 |
${yyyymmdd -7} |
20180102 |
$[yyyymmdd -7] |
20180103 |
|
2018-01-10 |
${yyyy-mm-dd} |
2018-01-09 |
$[yyyy-mm-dd] |
2018-01-10 |
|
2018-01-10 |
${yyyy-mm} |
2018-01 |
$[yyyy-mm] |
2018-01 |
|
2018-01-10 |
${yyyy-mm -1} |
2017-12 |
$[yyyy-mm -1] |
2017-12 |
|
2018-01-10 |
${yyyy} |
2018 |
$[yyyy] |
2018 |
|
2018-01-10 |
${yyyy+1} |
2019 |
$[yyyy + 1] |
2019 |
|
2018-01-10 |
${yyyy/MM/dd HH:mm:ss} |
2018/01/09 00:00:00 |
$[yyyy/MM/dd HH:mm:ss] |
2018/01/10 00:00:00 |
|
2018-01-10 |
${yyyy/MM/dd HH:mm:ss-1/24} |
2018/01/08 23:00:00 |
$[HH:mm:ss-5/24/60] |
23:55:00 |

