List of functions
- Applies to:
- Campaign Standard
- Topics:
- Workflows
CREATED FOR:
- Experienced
- Developer
About functions
The query editing tool allows you to use advanced functions to carry out complex filtering. To do this, the tool palette contains the Expression element that you can use in the workspace. Further information on this element is detailed in a specific section.
This element allows you to enter your conditions manually. Here you can use the functions defined in the following sections.
Several function types are available, depending on the desired results and the types of manipulated data:
- Dates
- Geomarketing
- Numerical values
- Other functions
- Aggregates
- String manipulation
- Sorting
Dates
The date functions are used to manipulate date or time values.
Name | Description | Syntax |
AddDays | Adds a number of days to a date | AddDays(<date>, <number>) |
AddHours | Adds a number of hours to a date | AddHours(<date>, <number>) |
AddMinutes | Adds a number of minutes to a date | AddMinutes(<date>, <number>) |
AddMonths | Adds a number of months to a date | AddMonths(<date>, <number>) |
AddSeconds | Adds a number of seconds to a date | AddSeconds(<date>, <number>) |
AddYears | Adds a number of years to a date | AddYears(<date>, <number>) |
DateOnly | Returns the date only (with time at 00:00) | DateOnly(<date>) |
Day | Returns the number representing the day of the date | Day(<date>) |
DayOfYear | Returns a number representing the day in the year of the date | DayOfYear(<date>) |
DaysAgo | Returns the current date minus n days | DaysAgo(<number>) |
DaysAgoInt | Returns the current date minus n days (as an integer yyyymmdd) | DaysAgoInt(<number>) |
DaysDiff | Number of days between two dates | DaysDiff(<end date>, <start date>) |
DaysOld | Returns the age in days of a date | DaysOld(<date>) |
GetDate | Returns the current system date of the server | GetDate() |
Hour | Returns the hour of the date | Hour(<date>) |
HoursDiff | Returns the number of hours between two dates | HoursDiff(<end date>, <start date>) |
LocalToUTC | Converts a local date and time to UTC | LocalToUTC(<date>, <Time Zone>) |
Minute | Returns the minutes of the date | Minute(<date>) |
MinutesDiff | Returns the number of minutes between two dates | MinutesDiff(<end date>, <start date>) |
Month | Returns the number representing the month of the date | Month(<date>) |
MonthsAgo | Returns the date corresponding to the current date minus n months | MonthsAgo(<number>) |
MonthsDiff | Returns the number of months between two dates | MonthsDiff(<end date>, <start date>) |
MonthsOld | Returns the age in months of a date | MonthsOld(<date>) |
Second | Returns the seconds of the date | Second(<date>) |
Oldest | Returns the oldest date | Oldest(<Date>, <Date>) |
SecondsDiff | Returns the number of seconds between two dates | SecondsDiff(<end date>, <start date>) |
SubDays | Subtracts a number of days from a date | SubDays(<date>, <number>) |
SubHours | Subtracts a number of hours from a date | SubHours(<date>, <number>) |
SubMinutes | Subtracts a number of minutes from a date | SubMinutes(<date>, <number>) |
SubMonths | Subtracts a number of months from a date | SubMonths(<date>, <number>) |
SubSeconds | Subtracts a number of seconds from a date | SubSeconds(<date>, <number>) |
SubYears | Subtracts a number of years from a date | SubYears(<date>, <number>) |
ToDate | Converts a date + time as a date | ToDate(<date + time>) |
ToDateTime | Converts a string to a date + time | ToDateTime(<string>) |
ToDateTimeWithTimezone | Converts a string to a date + timezone. Example: ToDateTimeWithTimezone ("2019-02-19 08:09:00", "Asia/Tehran") | ToDateTimeWithTimezone(<string>) |
TruncDate | Rounds a date+time to the nearest second | TruncDate(@lastModified, <number of seconds>) |
TruncDateTZ | Rounds a date + time to a given precision expressed in seconds | TruncDateTZ(<date>, <number of seconds>, <time zone>) |
TruncQuarter | Rounds a date off to the quarter | TruncQuarter(<date>) |
TruncTime | Rounds the time part up to the nearest second | TruncTime(<date>, <number of seconds>) |
TruncWeek | Rounds a date off to the week | TruncWeek(<date>) |
TruncYear | Rounds a date + time to January 1st of the year | TruncYear(<date>) |
WeekDay | Returns the number representing the day in the week of the date | WeekDay(<date>) |
Year | Returns the number representing the year of the date | Year(<date>) |
YearAnd Month | Returns the number representing the year and month of the date | YearAndMonth(<date>) |
YearsDiff | Returns the number of years between the two dates | YearsDiff(<end date>, <start date>) |
YearsOld | Returns the age in years of a date | YearsOld(<date>) |
Geomarketing
The geomarketing functions are used to manipulate geographical values.
Name | Description | Syntax |
Distance | Returns the distance in kilometers between two points defined by their longitude and latitude (expressed in degrees) | Distance(<Longitude A>, <Latitude A>, <Longitude B>, <Latitude B>) |
Numerical
The numerical value functions are used to convert text to numbers.
Name | Description | Syntax |
Abs | Returns the absolute value of a number | Abs(<number>) |
Ceil | Returns the lowest integer greater than or equal to a number | Ceil(<number>) |
Floor | Returns the greatest integer lower than or equal to a number | Floor(<number>) |
Greatest | Returns the greater of two numbers | Greatest(<number 1>, <number 2>) |
Least | Returns the smaller of two numbers | Least(<number 1>, <number 2>) |
Mod | Returns the remainder of the integer division from n1 by n2 | Mod(<number 1>, <number 2>) |
Percent | Returns the ratio of two numbers expressed as a percentage | Percent(<number 1>, <number 2>) |
Random | Returns the random value | Random() |
Round | Rounds off a number to n decimals | Round(<number>, <number of decimals>) |
Sign | Returns the sign of the number | Sign(<number>) |
ToDouble | Converts an integer to a float | ToDouble(<number>) |
ToInt64 | Converts a float to a 64 bit integer | ToInt64(<number>) |
ToInteger | Converts a float to an integer | ToInteger(<number>) |
Trunc | Truncates n1 to n2 decimals | Trunc(<n1>, <n2>) |
Others
This table contains the remaining functions available.
String
The string functions are used to manipulate a set of strings.
Please note that key size can be 128 bits, 192 bits, 256 bits (16, 24, 32 hexadecimal characters) but we advise you to use 256 bits and a randomized IV of the same length as the key.
For example: encryption_aescbcEncrypt(johndoe@example.com, "\\x0123456789ABCDEF0123456789ABCDEF", "\\x0123456789ABCDEFFEDCBA9876543210")
Aggregates
The aggregation functions are only available when adding additional data from a workflow’s Query activity.
The aggregate functions are used to perform calculations on a set of values.
Representation
The representation functions are used to order values.