PQL literals

PQL provides support for the following literal types:

LiteralDefinitionExample
StringA data type comprised of characters surrounded by double quotes."pizza", "jobs", "antidisestablishmentarianism"
BooleanA data type that is either true or false.true, false
IntegerA data type representing a whole number. It can be positive, negative, or zero.-201, 0, 412
DoubleA data type representing any real number. It can be positive, negative, or zero.-51.24, 3.14, 0.6942058
DateA 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)
ArrayA 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.

  • now, today, yesterday, tomorrow
  • this, last, next
  • before, after, from
  • millisecond(s), second(s), minute(s), hour(s), day(s), week(s), month(s), year(s), decade(s), century/centuries, millennium/millennia
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.

CategoryDefinition
BooleanUsed to implement boolean algebra within PQL. More information about these functions can be found in the boolean functions document.
ComparisonUsed to compare between different PQL elements. More information about these functions can be found in the comparison functions document.
Array, list, and setUsed to interact with arrays, lists, and sets. More information about these functions can be found in the array, list, and set functions document.
MapUsed to interact with maps. More information about these functions can be found in the map functions document.
StringUsed to interact with strings. More information about these functions can be found in the string functions document.
ObjectUsed to interact with objects. More information about these functions can be found in the object functions document.
ArithmeticUsed to perform basic arithmetic on PQL elements. More information about these functions can be found in the arithmetic functions document
AggregationUsed 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 timeUsed in conjunction with date, time, and datetime objects. More information about these functions can be found in the date/time functions document.
FilterUed to filter data within arrays. More information about these functions can be found in the filter functions document.
Logical quantifiersUsed to assert conditions within an array. More information can be found in the logical quantifiers document.
MiscellaneousFunctions 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