PQL literals
PQL provides support for the following literal types:
Literal | Definition | Example |
---|---|---|
String | A data type comprised of characters surrounded by double quotes. | "pizza" , "jobs" , "antidisestablishmentarianism" |
Boolean | A data type that is either true or false. | true , false |
Integer | A data type representing a whole number. It can be positive, negative, or zero. | -201 , 0 , 412 |
Double | A data type representing any real number. It can be positive, negative, or zero. | -51.24 , 3.14 , 0.6942058 |
Date | A data type that can be used to create dates based on the year, month, and day as integer parameters. It is formatted as date(year, month, day) | date(2020, 3, 14) |
Array | A data type that is comprised as a group of other literal values. It uses square brackets to group and commas to delimit between different values. Note: You cannot directly access properties of items within an array. So, if you need to access a property within an array, the supported method is select X from array where X.item = ... .PQL reserves the word xEvent to refer to an array of experience events linked to a profile. | [1, 4, 7] , ["US", "CA"] |
Relative time references |
Reserved words that can be used to form timestamp and time interval references.
| X.timestamp occurs before today , X.timestamp occurs last month , X.timestamp occurs <= 3 days before now |
PQL functions
The following table outlines the different categories of supported PQL functions, including links to further documentation for more information.
Category | Definition |
---|---|
Boolean | Used to implement boolean algebra within PQL. More information about these functions can be found in the boolean functions document. |
Comparison | Used to compare between different PQL elements. More information about these functions can be found in the comparison functions document. |
Array, list, and set | Used to interact with arrays, lists, and sets. More information about these functions can be found in the array, list, and set functions document. |
Map | Used to interact with maps. More information about these functions can be found in the map functions document. |
String | Used to interact with strings. More information about these functions can be found in the string functions document. |
Object | Used to interact with objects. More information about these functions can be found in the object functions document. |
Arithmetic | Used to perform basic arithmetic on PQL elements. More information about these functions can be found in the arithmetic functions document |
Aggregation | Used to combine results of an array into a singular result. More information about aggregation functions can be found in the aggregation functions document. |
Date and time | Used in conjunction with date, time, and datetime objects. More information about these functions can be found in the date/time functions document. |
Filter | Ued to filter data within arrays. More information about these functions can be found in the filter functions document. |
Logical quantifiers | Used to assert conditions within an array. More information can be found in the logical quantifiers document. |
Miscellaneous | Functions that do not fit in any of the above categories can be found in the miscellaneous functions document. |
Next steps
Now that you’ve learned how to use Profile Query Language, you can use PQL when creating and modifying segment definitions. For more information on segmentation, please read the segmentation overview.
Previous pageEnforce data usage compliance for audiences
Next pageBoolean functions