Dataflow Automation
What's covered in this article
- What is Dataflow Automation?
- What is a Dataflow Automation built-in function?
- What are the available built-in functions?
What is Dataflow Automation?
Dataflow Automation provides organizations Big Data capabilities including long term storage, data management, processing and integration without having to invest millions of dollars and a dedicated team. With Zerion Dataflows, centralize data throughout your organization and leverage your data in ways never imagined.
Click here for more information on Dataflow Automation.
What is a Dataflow Automation built-in function?
The built-in functions of Dataflow Automation are primarily used for transforming data. You can apply each built-in function using the following syntax: dataflow.functionName() or dataflow.library.functionName().
These built-in functions can be used in either the Transform Code or Transform Return section; however, it is recommended to always create a custom function in the Transform Code, even for simple transformations.
What are the available built-in functions?
The following is a list of each of the built-in functions. Please click on each for more details.
- toKeysLowerCase()
- toKeysUpperCase()
- Date.addTime()
- Date.subtractTime()
- Date.toDateString()
- Date.toUTCString()
Also, check out:
toKeysLowerCase()
The dataflow.toKeysLowerCase(record) function will convert all keys in an object to lowercase. The key is the unique identifier for a value. Supply the record that you wish to convert as a single argument in the function call.
Before | After |
|
|
toKeysUpperCase()
The dataflow.toKeysUpperCase(record) function will convert all keys in an object to uppercase. The key is the unique identifier for a value. Supply the record that you wish to convert as a single argument in the function call.
Before | After |
|
|
Date.addTime()
The dataflow.Date.addTime() function will add a specified amount of time to a supplied datetime. This function is not used to subtract time from a given datetime. The unit(s) of time are specified as an object in the second argument. The following units of time may be used:
- milliseconds
- seconds
- minutes
- hours
- days
- weeks
- months
- years
dataflow.Date.addTime(new Date(),{hours: 5}) | |
|
|
dataflow.Date.addTime("2013-12-24 14:30",{hours: 5}) | |
|
|
dataflow.Date.addTime("2013-12-24 14:30",{days: 1, minutes: 30}) | |
|
|
Date.subtractTime()
The dataflow.Date.subtractTime() function will subtract a specified amount of time from a supplied datetime. The unit(s) of time are specified as an object in the second argument. The following units of time may be used:
- milliseconds
- seconds
- minutes
- hours
- days
- weeks
- months
- years
dataflow.Date.subtractTime(new Date(),{hours: 5}) | |
|
|
dataflow.Date.subtractTime("2013-12-24 14:30",{hours: 5}) | |
|
|
dataflow.Date.subtractTime("2013-12-24 14:30",{days: 1, minutes: 30}) | |
|
|
Date.toDateString()
The dataflow.Date.toDateString function will output a given date as a formatted string. The function requires two arguments. The first value is the date to be formatted, the second value is the formatting instruction for the string. If no arguments are supplied, the function will return the current date in a default format.
Date.toUTCString()
The datataflow.Date.toUTCString function will output a given date as a formatted string converted to Coordinated Universal Time (UTC). The function requires two arguments. The first value is the date to be formatted, the second value is the formatting instruction for the string. If no arguments are supplied, the function will return the current date in a default format.
Date String Formatting Table
Use the following table to guide your formatted date/time strings using the toDateString() and toUTCString() functions.
Formatting Mask | Expected Output |
YYYY | Four digit year including leading zeroes |
YY | Two digit year, will include a leading zero if necessary |
Q | The quarter of the year (1,2,3,4) |
M | Month number without leading zero |
MM | Month number with leading zero |
MMM | Abbreviated month name |
MMMM | Full month name |
D | Day of the month without leading zero |
DD | Day of the month with leading zero |
DDD | Day of the year without leading zero(es) |
DDDD | Day of the year with leading zero(es) |
Do | Day of month with ordinal (1st, 2nd, 30th, 31st) |
H | Hour without leading zero (0-23) |
HH | Hour with leading zero (00-23) |
h | Hour without leading zero (1-12) |
hh | Hour with leading zero (01-12) |
k | Offset Hour without leading zero (1-24) |
kk | Offset Hour with leading zero (01-24) |
m | Minutes without leading zero (0-59) |
mm | Minutes with leading zero (00-59) |
s | Seconds without leading zero (0-59) |
ss | Seconds with leading zero (00-59) |
Z | Offset from UTC (+/- HH:mm) |
ZZ | Offset from UTC (+/- HHmm) |
X | Unix timestamp |
x | Unix timestamp in milliseconds |
Comments
0 comments
Please sign in to leave a comment.