Appearance
Logic functions
and
Returns true if all the given values are true, false otherwise.
Arguments
valueExpression that represents a logical value
and(Boolean, [Boolean, ...]): Boolean
Example
Column A: prop("Plan") == 'pro' && prop("Payment problems")
| Account | Status | Plan | Payment problems | Column A |
|---|---|---|---|---|
| Acct 1 | active | pro | no | no |
| Acct 2 | active | basic | no | no |
| Acct 3 | suspended | pro | yes | yes |
| Acct 4 | active | basic | yes | no |
or
Returns true if at least one of the given values is true, false otherwise.
Arguments
valueExpression that represents a logical value
or(Boolean, [Boolean, ...]): Boolean
Example
Needs attention: prop("Status") == "idle" || prop("Urgent")
| Account | Status | Urgent | Needs attention |
|---|---|---|---|
| Acct 1 | active | no | no |
| Acct 2 | idle | no | yes |
| Acct 3 | active | yes | yes |
| Acct 4 | closed | no | no |
not
Returns true if the given value is false, false otherwise.
Arguments
valueExpression that represents a logical value
not(Boolean): Boolean
Example
Needs onboarding: not(prop("Is onboarded"))
| Account | Onboarded | Needs onboarding |
|---|---|---|
| Acct 1 | yes | no |
| Acct 2 | no | yes |
| Acct 3 | no | yes |
| Acct 4 | yes | no |
eq
Equality check. Returns true if two given values are equal
Arguments
value1First valuevalue2Value to test against value1 for equality
Supported signatures
eq(String | Enum, String | Enum): Booleaneq(Number | Float | Integer, Number | Float | Integer): Booleaneq(Boolean, Boolean): Booleaneq(Date, Date): Boolean
Example
Is active: prop("Status") == "active"
| Account | Status | Is active |
|---|---|---|
| Acct 1 | active | yes |
| Acct 2 | inactive | no |
| Acct 3 | active | yes |
neq
Non-equality check. Returns false if two given values are equal, true otherwise.
Arguments
value1First valuevalue2Value to test against value1 for equality
Supported signatures
neq(String | Enum, String | Enum): Booleanneq(Number | Float | Integer, Number | Float | Integer): Booleanneq(Boolean, Boolean): Booleanneq(Date, Date): Boolean
Example
Not pending: prop("Status") != "pending"
| Order | Status | Not pending |
|---|---|---|
| Order 1 | completed | yes |
| Order 2 | pending | no |
| Order 3 | shipped | yes |
gt
Returns true if the first value is greater than the second, false otherwise.
Arguments
value1Value to test being greater than value2value2Second value
Supported signatures
gt(String | Enum, String | Enum): Booleangt(Number | Float | Integer, Number | Float | Integer): Booleangt(Boolean, Boolean): Booleangt(Date, Date): Boolean
Example
High value: prop("Amount") > 1000
| Order | Amount | High value |
|---|---|---|
| Order 1 | 1500.0 | yes |
| Order 2 | 850.0 | no |
| Order 3 | 2100.0 | yes |
gte
Returns true if the first value is greater than or equal to the second, false otherwise.
Arguments
value1Value to test being greater or equal than value2value2Second value
Supported signatures
gte(String | Enum, String | Enum): Booleangte(Number | Float | Integer, Number | Float | Integer): Booleangte(Boolean, Boolean): Booleangte(Date, Date): Boolean
Example
Eligible: prop("Score") >= 75
| Student | Score | Eligible |
|---|---|---|
| Student 1 | 85 | yes |
| Student 2 | 75 | yes |
| Student 3 | 68 | no |
lt
Returns true if the first value is less than the second, false otherwise.
Arguments
value1Value to test being less than value2value2Second value
Supported signatures
lt(String | Enum, String | Enum): Booleanlt(Number | Float | Integer, Number | Float | Integer): Booleanlt(Boolean, Boolean): Booleanlt(Date, Date): Boolean
Example
Low stock: prop("Stock") < 10
| Product | Stock | Low stock |
|---|---|---|
| Product 1 | 5 | yes |
| Product 2 | 15 | no |
| Product 3 | 8 | yes |
lte
Returns true if the first value is less than or equal to the second, false otherwise.
Arguments
value1Value to test being less or equal than value2value2Second value
Supported signatures
lte(String | Enum, String | Enum): Booleanlte(Number | Float | Integer, Number | Float | Integer): Booleanlte(Boolean, Boolean): Booleanlte(Date, Date): Boolean
Example
On budget: prop("Spent") <= prop("Budget")
| Project | Spent | Budget | On budget |
|---|---|---|---|
| Project 1 | 8500 | 10000 | yes |
| Project 2 | 12000 | 10000 | no |
| Project 3 | 10000 | 10000 | yes |
in
Returns true if the value is one of the following values, false otherwise.
Arguments
valueValue to checkvaluesValues to check from
in(String | Number | Float | Integer | Enum, [String | Number | Float | Integer | Enum, ...]): Boolean
Example
Is priority: in(prop("Plan"), "pro", "enterprise")
| Account | Plan | Is priority |
|---|---|---|
| Acct 1 | free | no |
| Acct 2 | pro | yes |
| Acct 3 | basic | no |
| Acct 4 | enterprise | yes |
Control flow
case
Returns the first value that matches its preceding condition. An optional value is returned if it is provided and none of the conditions match.
Arguments
conditionCondition to matchvalueValue to return if the preceding condition is truedefault(Optional) Value to return if no conditions match
Supported signatures
case(Boolean, String | Enum, [Boolean, String | Enum, ...], String?): Stringcase(Boolean, Number | Float | Integer, [Boolean, Number | Float | Integer, ...], Number | Float | Integer?): Numbercase(Boolean, Float, [Boolean, Float, ...], Float?): Floatcase(Boolean, Integer, [Boolean, Integer, ...], Integer?): Integercase(Boolean, Date, [Boolean, Date, ...], Date?): Datecase(Boolean, Interval, [Boolean, Interval, ...], Interval?): Intervalcase(Boolean, Boolean, [Boolean, Boolean, ...], Boolean?): Boolean
Example
Priority: case(prop("Plan") == "enterprise", "High", prop("Plan") == "pro", "Medium", "Low")
| Account | Plan | Priority |
|---|---|---|
| Acct 1 | enterprise | High |
| Acct 2 | pro | Medium |
| Acct 3 | basic | Low |
| Acct 4 | free | Low |
Mathematical functions
add
Returns the sum of given values.
Arguments
valueValue to sum together with previous value
Supported signatures
add(Number, [Number, ...]): Numberadd(Float, [Float, ...]): Floatadd(Integer, [Integer, ...]): Integeradd(Number | Float | Integer, [Number | Float | Integer, ...]): Numberadd(Interval, [Interval, ...]): Intervaladd(Date, Interval): Dateadd(Interval, Date): Date
Example
Total: prop("Price") + prop("Tax") + prop("Shipping")
| Order | Price | Tax | Shipping | Total |
|---|---|---|---|---|
| Order 1 | 99.00 | 8.9 | 5.00 | 112.9 |
| Order 2 | 45.50 | 4.1 | 3.50 | 53.1 |
| Order 3 | 78.25 | 7.0 | 4.75 | 90.0 |
sub
Returns the subtraction of given values.
Arguments
valueValue to subtract from previous value
Supported signatures
sub(Number, [Number, ...]): Numbersub(Float, [Float, ...]): Floatsub(Integer, [Integer, ...]): Integersub(Number | Float | Integer, [Number | Float | Integer, ...]): Numbersub(Date, Date): Intervalsub(Date, Interval): Datesub(Interval, Interval): Interval
Example
Profit: prop("Revenue") - prop("Costs")
| Product | Revenue | Costs | Profit |
|---|---|---|---|
| Product 1 | 1500.00 | 950.0 | 550.0 |
| Product 2 | 2300.50 | 1800 | 500.5 |
| Product 3 | 875.25 | 600.5 | 274.75 |
mul
Returns the multiplication of given values.
Arguments
valueValue to multiply to previous value
Supported signatures
mul(Number, [Number, ...]): Numbermul(Float, [Float, ...]): Floatmul(Integer, [Integer, ...]): Integermul(Number | Float | Integer, [Number | Float | Integer, ...]): Numbermul(Interval, Number): Intervalmul(Number, Interval): Interval
Example
Total: prop("Quantity") * prop("Unit price")
| Item | Quantity | Unit price | Total |
|---|---|---|---|
| Item 1 | 5 | 19.99 | 99.95 |
| Item 2 | 12 | 7.50 | 90.00 |
| Item 3 | 3 | 45.00 | 135.00 |
div
Returns the division of given values.
Arguments
dividendThe value to be divideddivisorThe number to divide by
Supported signatures
div(Float | Integer, Float | Integer): Floatdiv(Number | Float | Integer, Number | Float | Integer): Numberdiv(Interval, Number): Interval
Example
Average: prop("Total") / prop("Count")
| Product | Total | Count | Average |
|---|---|---|---|
| Product 1 | 450.0 | 5 | 90.0 |
| Product 2 | 780.0 | 12 | 65.0 |
| Product 3 | 225.0 | 3 | 75.0 |
pow
Converts value to the power of the given exponent.
Arguments
valueValue to raise to the power of the exponentexponent(Optional) Exponent to raise the value to
Supported signatures
pow(Number, Number): Numberpow(Integer, Number): Integerpow(Float, Number): Float
Example
Squared: pow(prop("Value"), 2)
| Item | Value | Squared |
|---|---|---|
| Item 1 | 3 | 9 |
| Item 2 | 5 | 25 |
| Item 3 | 8 | 64 |
sqrt
Returns the square root of the given value.
Arguments
valueValue to get the square root of
Supported signatures
sqrt(Number): Numbersqrt(Integer): Numbersqrt(Float): Float
Example
Root: sqrt(prop("Area"))
| Square | Area | Root |
|---|---|---|
| Square 1 | 9 | 3 |
| Square 2 | 16 | 4 |
| Square 3 | 25 | 5 |
max
Returns the maximum value from the given values.
Arguments
valueValue to consider as maximum value
Supported signatures
max(Number, [Number, ...]): Numbermax(Float, [Float, ...]): Floatmax(Integer, [Integer, ...]): Integermax(Number | Float | Integer, [Number | Float | Integer, ...]): Numbermax(Date, [Date, ...]): Datemax(Interval, [Interval, ...]): Interval
Example
Highest: max(prop("Q1"), prop("Q2"), prop("Q3"))
| Product | Q1 | Q2 | Q3 | Highest |
|---|---|---|---|---|
| Product 1 | 120 | 145 | 138 | 145 |
| Product 2 | 95 | 102 | 88 | 102 |
| Product 3 | 225 | 198 | 210 | 225 |
min
Returns the minimum value from the given values.
Arguments
valueValue to consider as minimum value
Supported signatures
min(Number, [Number, ...]): Numbermin(Float, [Float, ...]): Floatmin(Integer, [Integer, ...]): Integermin(Number | Float | Integer, [Number | Float | Integer, ...]): Numbermin(Date, [Date, ...]): Datemin(Interval, [Interval, ...]): Interval
Example
Lowest: min(prop("Q1"), prop("Q2"), prop("Q3"))
| Product | Q1 | Q2 | Q3 | Lowest |
|---|---|---|---|---|
| Product 1 | 120 | 145 | 138 | 120 |
| Product 2 | 95 | 88 | 102 | 88 |
| Product 3 | 210 | 198 | 225 | 198 |
ceil
Returns the smallest integer greater than or equal to the given value.
Arguments
valueValue to round up
ceil(Number | Float | Integer): Number
Example
Rounded up: ceil(prop("Value"))
| Item | Value | Rounded up |
|---|---|---|
| Item 1 | 3.14 | 4 |
| Item 2 | 7.89 | 8 |
| Item 3 | 5.01 | 6 |
floor
Returns the largest integer less than or equal to the given value.
Arguments
valueValue to round down
floor(Number | Float | Integer): Number
Example
Rounded down: floor(prop("Value"))
| Item | Value | Rounded down |
|---|---|---|
| Item 1 | 3.14 | 3 |
| Item 2 | 7.89 | 7 |
| Item 3 | 5.99 | 5 |
round
Returns the value rounded to the nearest integer.
Arguments
valueValue to round to the nearest integerprecisionAn integer specifying the number of significant digits
Supported signatures
round(Number | Float | Integer, Number): Numberround(Number | Float | Integer): Number
Example
Rounded: round(prop("Value"), 1)
| Item | Value | Rounded |
|---|---|---|
| Item 1 | 3.14 | 3.1 |
| Item 2 | 7.89 | 7.9 |
| Item 3 | 5.55 | 5.6 |
String functions
contains
Returns true if the first value contains the second value (case-insensitive), false otherwise.
Arguments
search_stringString to search for the presence of lookup stringlookup_stringString to search for within the search string
Supported signatures
contains(String, String): Booleancontains(Enum, String): Boolean
Example
Has keyword: contains(prop("Description"), "urgent")
| Task | Description | Has keyword |
|---|---|---|
| Task 1 | Fix urgent bug | yes |
| Task 2 | Review code | no |
| Task 3 | URGENT: Deploy hotfix | yes |
| Task 4 | Update documentation | no |
Case-insensitive search for substring within text.
split_part
Splits the given string by the given delimiter and returns the part at the given position. The position is 1-based. If the position is greater than the number of parts, a null value is returned.
Arguments
stringString to splitdelimiterDelimiter to split the string bypositionPosition of the part to return
split_part(String | Enum, String, Number): String
Example
Domain: split_part(prop("Email"), "@", 2)
| User | Domain | |
|---|---|---|
| User 1 | alice@example.com | example.com |
| User 2 | bob@company.org | company.org |
| User 3 | charlie@domain.net | domain.net |
Extracts the domain from email addresses using '@' as delimiter.
substring
Returns a substring of the given string from the start position for the specified length.
Arguments
stringString to extract the substring fromstartStart position (1-based), negative values count from the endlengthLength of the substring, cannot be negative
substring(String | Enum, Number, Number): String
Example
Code: substring(prop("Product ID"), 1, 3)
| Product | Product ID | Code |
|---|---|---|
| Product 1 | PRD-12345 | PRD |
| Product 2 | ACC-67890 | ACC |
| Product 3 | SRV-24680 | SRV |
Extracts the first 3 characters starting from position 1.
concat
Concatenates given values into a single string.
Arguments
valueValue to concatenate
concat(String | Number | Float | Integer | Enum, [String | Number | Float | Integer | Enum, ...]): String
Example
Full name: concat(prop("First name"), " ", prop("Last name"))
| User | First name | Last name | Full name |
|---|---|---|---|
| User 1 | Alice | Smith | Alice Smith |
| User 2 | Bob | Johnson | Bob Johnson |
| User 3 | Charlie | Williams | Charlie Williams |
Combines first and last names with a space separator.
len
Returns the length of the string from the given value.
Arguments
stringString to get the length of
len(String | Enum): Integer
Example
Length: len(prop("Title"))
| Article | Title | Length |
|---|---|---|
| Article 1 | Getting Started with TypeScript | 31 |
| Article 2 | Advanced React Patterns | 23 |
| Article 3 | API Design | 10 |
Counts the number of characters in each string.
Date functions
date
Returns the given value as a Date.
Arguments
valueValue to convert to a date
date(String | Date): Date
Example
Parsed: date(prop("Created"))
| Event | Created | Parsed |
|---|---|---|
| Event 1 | 2024-03-15 | 2024-03-15 |
| Event 2 | 2024-06-20 | 2024-06-20 |
| Event 3 | 2024-09-10 | 2024-09-10 |
now
Returns the current date and time.
Arguments
now(): Date
Example
Current time: now()
Returns the current date and time when the query executes, for example: 2024-03-15 14:30:45
year
Extracts the year from the given date value.
Arguments
dateDate value to extract the year from
year(Date): Integer
Example
Year: year(prop("Date"))
| Event | Date | Year |
|---|---|---|
| Event 1 | 2023-03-15 | 2023 |
| Event 2 | 2024-06-20 | 2024 |
| Event 3 | 2024-09-10 | 2024 |
quarter
Extracts the quarter from the given date value.
Arguments
dateDate value to extract the quarter from
quarter(Date): Integer
Example
Quarter: quarter(prop("Date"))
| Event | Date | Quarter |
|---|---|---|
| Event 1 | 2024-02-15 | 1 |
| Event 2 | 2024-06-20 | 2 |
| Event 3 | 2024-11-10 | 4 |
month
Extracts the month from the given date value.
Arguments
dateDate value to extract the month from
month(Date): Integer
Example
Month: month(prop("Date"))
| Event | Date | Month |
|---|---|---|
| Event 1 | 2024-02-15 | 2 |
| Event 2 | 2024-06-20 | 6 |
| Event 3 | 2024-11-10 | 11 |
week
Extracts the week number from the given date value.
Arguments
dateDate value to extract the week number from
week(Date): Integer
Example
Week: week(prop("Date"))
| Event | Date | Week |
|---|---|---|
| Event 1 | 2024-01-08 | 2 |
| Event 2 | 2024-06-20 | 25 |
| Event 3 | 2024-12-30 | 53 |
day
Extracts the day from the given date value.
Arguments
dateDate value to extract the day from
day(Date): Integer
Example
Day: day(prop("Date"))
| Event | Date | Day |
|---|---|---|
| Event 1 | 2024-03-05 | 5 |
| Event 2 | 2024-06-20 | 20 |
| Event 3 | 2024-09-15 | 15 |
hour
Extracts the hour from the given date value.
Arguments
dateDate value to extract the hour from
hour(Date): Integer
Example
Hour: hour(prop("Timestamp"))
| Event | Timestamp | Hour |
|---|---|---|
| Event 1 | 2024-03-15 08:30:00 | 8 |
| Event 2 | 2024-06-20 14:45:00 | 14 |
| Event 3 | 2024-09-10 22:15:00 | 22 |
minute
Extracts the minute from the given date value.
Arguments
dateDate value to extract the minute from
minute(Date): Integer
Example
Minute: minute(prop("Timestamp"))
| Event | Timestamp | Minute |
|---|---|---|
| Event 1 | 2024-03-15 08:15:00 | 15 |
| Event 2 | 2024-06-20 14:45:00 | 45 |
| Event 3 | 2024-09-10 22:30:00 | 30 |
second
Extracts the second from the given date value.
Arguments
dateDate value to extract the second from
second(Date): Integer
Example
Second: second(prop("Timestamp"))
| Event | Timestamp | Second |
|---|---|---|
| Event 1 | 2024-03-15 08:30:12 | 12 |
| Event 2 | 2024-06-20 14:45:38 | 38 |
| Event 3 | 2024-09-10 22:15:55 | 55 |
day_of_week
Extracts the day of the week from the given date value.
Arguments
dateDate value to extract the day of the week from
day_of_week(Date): Integer
Example
Day of week: day_of_week(prop("Date"))
| Event | Date | Day of week |
|---|---|---|
| Event 1 | 2024-03-11 | 1 |
| Event 2 | 2024-06-20 | 4 |
| Event 3 | 2024-09-15 | 7 |
Date utility functions
interval
Creates an interval value of the given duration.
Arguments
countHow many periods in the intervalperiodLength of one period (allowed values:'year','quarter','month','week','day','hour','minute','second','millisecond')
interval(Integer | Number, String): Interval
Example
Duration: interval(prop("Count"), prop("Unit"))
| Task | Count | Unit | Duration |
|---|---|---|---|
| Task 1 | 5 | days | 5 days |
| Task 2 | 2 | weeks | 2 weeks |
| Task 3 | 3 | months | 3 months |
extract
Extracts given date part from the given interval.
Arguments
intervalInterval valuefieldDate part to extract (allowed values:'year','quarter','month','week','day','hour','minute','second','millisecond')
extract(Interval, String | Enum): Number
Example
Days: extract(prop("Duration"), "days")Months: extract(prop("Duration"), "months")
| Task | Duration | Days | Months |
|---|---|---|---|
| Task 1 | 5 days | 5 | 0 |
| Task 2 | 2 weeks | 14 | 0 |
| Task 3 | 3 months | 90 | 3 |
Extracts the number of days or months from an interval value.
date_diff
Calculates the difference between two dates in the specified unit.
Arguments
date1First date valuedate2Second date valueunitUnit of the result (allowed values:'year','quarter','month','week','day','hour','minute','second')
date_diff(Date, Date, String | Enum): Number
Example
Days: date_diff(prop("End date"), prop("Start date"), "days")
| Project | Start date | End date | Days |
|---|---|---|---|
| Project 1 | 2024-03-01 | 2024-03-15 | 14 |
| Project 2 | 2024-06-01 | 2024-06-20 | 19 |
| Project 3 | 2024-09-01 | 2024-10-05 | 34 |
net_work_days
Returns the number of net work days (business days) between two dates.
Arguments
start_dateStart dateend_dateEnd date
net_work_days(Date, Date): Integer
Example
Work days: net_work_days(prop("Start date"), prop("End date"))
| Project | Start date | End date | Work days |
|---|---|---|---|
| Project 1 | 2024-03-01 | 2024-03-15 | 10 |
| Project 2 | 2024-06-03 | 2024-06-14 | 9 |
| Project 3 | 2024-09-02 | 2024-09-20 | 14 |
start_of_year
Returns the given date value truncated to the start of the year.
Arguments
dateDate value to truncate
start_of_year(Date): Date
Example
Year start: start_of_year(prop("Date"))
| Event | Date | Year start |
|---|---|---|
| Event 1 | 2024-03-15 | 2024-01-01 |
| Event 2 | 2024-06-20 | 2024-01-01 |
| Event 3 | 2024-09-05 | 2024-01-01 |
end_of_year
Return the given date value truncated to the end of the year / start of next year.
Arguments
dateDate value to truncate
end_of_year(Date): Date
Example
Year end: end_of_year(prop("Date"))
| Event | Date | Year end |
|---|---|---|
| Event 1 | 2024-03-15 | 2024-12-31 |
| Event 2 | 2024-06-20 | 2024-12-31 |
| Event 3 | 2024-09-05 | 2024-12-31 |
start_of_quarter
Returns the given date value truncated to the start of the quarter.
Arguments
dateDate value to truncate
start_of_quarter(Date): Date
Example
Quarter start: start_of_quarter(prop("Date"))
| Event | Date | Quarter start |
|---|---|---|
| Event 1 | 2024-02-15 | 2024-01-01 |
| Event 2 | 2024-06-20 | 2024-04-01 |
| Event 3 | 2024-11-10 | 2024-10-01 |
end_of_quarter
Return the given date value truncated to the end of the quarter / start of next quarter.
Arguments
dateDate value to truncate
end_of_quarter(Date): Date
Example
Quarter end: end_of_quarter(prop("Date"))
| Event | Date | Quarter end |
|---|---|---|
| Event 1 | 2024-02-15 | 2024-03-31 |
| Event 2 | 2024-06-20 | 2024-06-30 |
| Event 3 | 2024-11-10 | 2024-12-31 |
start_of_month
Returns the given date value truncated to the start of the month.
Arguments
dateDate value to truncate
start_of_month(Date): Date
Example
Month start: start_of_month(prop("Date"))
| Event | Date | Month start |
|---|---|---|
| Event 1 | 2024-03-15 | 2024-03-01 |
| Event 2 | 2024-06-20 | 2024-06-01 |
| Event 3 | 2024-09-05 | 2024-09-01 |
end_of_month
Returns the given date value truncated to the end of the month / start of next month.
Arguments
dateDate value to truncate
end_of_month(Date): Date
Example
Month end: end_of_month(prop("Date"))
| Event | Date | Month end |
|---|---|---|
| Event 1 | 2024-03-15 | 2024-03-31 |
| Event 2 | 2024-06-20 | 2024-06-30 |
| Event 3 | 2024-09-05 | 2024-09-30 |
start_of_week
Returns the given date value truncated to the start of the week.
Arguments
dateDate value to truncate
start_of_week(Date): Date
Example
Week start: start_of_week(prop("Date"))
| Event | Date | Week start |
|---|---|---|
| Event 1 | 2024-03-13 | 2024-03-11 |
| Event 2 | 2024-06-20 | 2024-06-17 |
| Event 3 | 2024-09-05 | 2024-09-02 |
end_of_week
Returns the given date value truncated to the end of the week / start of next week.
Arguments
dateDate value to truncate
end_of_week(Date): Date
Example
Week end: end_of_week(prop("Date"))
| Event | Date | Week end |
|---|---|---|
| Event 1 | 2024-03-13 | 2024-03-17 |
| Event 2 | 2024-06-20 | 2024-06-23 |
| Event 3 | 2024-09-05 | 2024-09-08 |
start_of_day
Returns the given date value truncated to the start of the day.
Arguments
dateDate value to truncate
start_of_day(Date): Date
Example
Day start: start_of_day(prop("Timestamp"))
| Event | Timestamp | Day start |
|---|---|---|
| Event 1 | 2024-03-15 14:30:45 | 2024-03-15 00:00:00 |
| Event 2 | 2024-06-20 09:15:30 | 2024-06-20 00:00:00 |
| Event 3 | 2024-09-10 22:45:12 | 2024-09-10 00:00:00 |
end_of_day
Returns the given date value truncated to the end of the day / start of next day.
Arguments
dateDate value to truncate
end_of_day(Date): Date
Example
Day end: end_of_day(prop("Timestamp"))
| Event | Timestamp | Day end |
|---|---|---|
| Event 1 | 2024-03-15 14:30:45 | 2024-03-15 23:59:59 |
| Event 2 | 2024-06-20 09:15:30 | 2024-06-20 23:59:59 |
| Event 3 | 2024-09-10 22:45:12 | 2024-09-10 23:59:59 |
start_of_hour
Returns the given date value truncated to the start of the hour.
Arguments
dateDate value to truncate
start_of_hour(Date): Date
Example
Hour start: start_of_hour(prop("Timestamp"))
| Event | Timestamp | Hour start |
|---|---|---|
| Event 1 | 2024-03-15 14:30:45 | 2024-03-15 14:00:00 |
| Event 2 | 2024-06-20 09:15:30 | 2024-06-20 09:00:00 |
| Event 3 | 2024-09-10 22:45:12 | 2024-09-10 22:00:00 |
end_of_hour
Returns the given date value truncated to the end of the hour / start of next hour.
Arguments
dateDate value to truncate
end_of_hour(Date): Date
Example
Hour end: end_of_hour(prop("Timestamp"))
| Event | Timestamp | Hour end |
|---|---|---|
| Event 1 | 2024-03-15 14:30:45 | 2024-03-15 14:59:59 |
| Event 2 | 2024-06-20 09:15:30 | 2024-06-20 09:59:59 |
| Event 3 | 2024-09-10 22:45:12 | 2024-09-10 22:59:59 |
start_of_minute
Returns the given date value truncated to the start of the minute.
Arguments
dateDate value to truncate
start_of_minute(Date): Date
Example
Minute start: start_of_minute(prop("Timestamp"))
| Event | Timestamp | Minute start |
|---|---|---|
| Event 1 | 2024-03-15 14:30:45 | 2024-03-15 14:30:00 |
| Event 2 | 2024-06-20 09:15:30 | 2024-06-20 09:15:00 |
| Event 3 | 2024-09-10 22:45:12 | 2024-09-10 22:45:00 |
end_of_minute
Returns the given date value truncated to the end of the minute / start of next minute.
Arguments
dateDate value to truncate
end_of_minute(Date): Date
Example
Minute end: end_of_minute(prop("Timestamp"))
| Event | Timestamp | Minute end |
|---|---|---|
| Event 1 | 2024-03-15 14:30:45 | 2024-03-15 14:30:59 |
| Event 2 | 2024-06-20 09:15:30 | 2024-06-20 09:15:59 |
| Event 3 | 2024-09-10 22:45:12 | 2024-09-10 22:45:59 |
JSON functions
json_get_text
Returns the value of the given key from a json object as a string.
Arguments
objectJSON objectkeyKey to get the value of
json_get_text(Object, String): String
Example
Name: json_get_text(prop("Data"), "name")
| User | Data | Name |
|---|---|---|
| User 1 | {"name": "Alice", "age": 30} | Alice |
| User 2 | {"name": "Bob", "age": 25} | Bob |
| User 3 | {"name": "Charlie", "age": 35} | Charlie |
json_get_number
Returns the value of the given key from a json object as a number.
Arguments
objectJSON objectkeyKey to get the value of
json_get_number(Object, String): Number
Example
Price: json_get_number(prop("Data"), "price")
| Product | Data | Price |
|---|---|---|
| Product 1 | {"price": 19.99, "stock": 10} | 19.99 |
| Product 2 | {"price": 45.50, "stock": 5} | 45.50 |
| Product 3 | {"price": 12.75, "stock": 20} | 12.75 |
json_get_integer
Returns the value of the given key from a json object as an integer.
Arguments
objectJSON objectkeyKey to get the value of
json_get_integer(Object, String): Integer
Example
Stock: json_get_integer(prop("Data"), "stock")
| Product | Data | Stock |
|---|---|---|
| Product 1 | {"price": 19.99, "stock": 10} | 10 |
| Product 2 | {"price": 45.50, "stock": 5} | 5 |
| Product 3 | {"price": 12.75, "stock": 20} | 20 |
json_get_float
Returns the value of the given key from a json object as a float.
Arguments
objectJSON objectkeyKey to get the value of
json_get_float(Object, String): Float
Example
Rating: json_get_float(prop("Data"), "rating")
| Product | Data | Rating |
|---|---|---|
| Product 1 | {"rating": 4.5, "reviews": 120} | 4.5 |
| Product 2 | {"rating": 3.8, "reviews": 85} | 3.8 |
| Product 3 | {"rating": 4.9, "reviews": 200} | 4.9 |
json_get_timestamptz
Returns the value of the given key from a json object as a date.
Arguments
objectJSON objectkeyKey to get the value of
json_get_timestamptz(Object, String): Date
Example
Created: json_get_timestamptz(prop("Data"), "created")
| Order | Data | Created |
|---|---|---|
| Order 1 | {"created": "2024-03-15", "status": "ok"} | 2024-03-15 |
| Order 2 | {"created": "2024-06-20", "status": "ok"} | 2024-06-20 |
| Order 3 | {"created": "2024-09-10", "status": "ok"} | 2024-09-10 |
json_get_boolean
Returns the value of the given key from a json object as a boolean.
Arguments
objectJSON objectkeyKey to get the value of
json_get_boolean(Object, String): Boolean
Example
Active: json_get_boolean(prop("Data"), "active")
| Account | Data | Active |
|---|---|---|
| Account 1 | {"active": true, "verified": yes} | yes |
| Account 2 | {"active": false, "verified": no} | no |
| Account 3 | {"active": true, "verified": yes} | yes |
Type conversions
int
Returns the given value as an integer.
Arguments
valueValue to convert to an integer
int(Boolean | String | Enum | Number | Float | Integer): Integer
Example
As integer: int(prop("Price"))
| Product | Price | As integer |
|---|---|---|
| Item A | 9.99 | 9 |
| Item B | 15.50 | 15 |
| Item C | 7.25 | 7 |
Converts decimal values to integers by truncating.
float
Returns the given value as a floating point number.
Arguments
valueValue to convert to a float
float(String | Enum | Number | Float | Integer): Float
Example
As float: float(prop("Count"))
| Product | Count | As float |
|---|---|---|
| Item A | 5 | 5.00 |
| Item B | 12 | 12.00 |
| Item C | 8 | 8.00 |
Converts integers to floating point numbers.
str
Returns the given value as a string.
Arguments
valueValue to convert to a string
str(Boolean | String | Enum | Number | Float | Integer | Date | Object | Interval): String
Example
As string: str(prop("Value"))
| Product | Value | As string |
|---|---|---|
| Item A | 42 | "42" |
| Item B | 3.14 | "3.14" |
| Item C | true | "true" |
Converts values to their string representation.
bool
Returns the given value as a boolean.
Arguments
valueValue to convert to a boolean
bool(Boolean | Number | Integer): Boolean
Example
As boolean: bool(prop("Active"))
| Product | Active | As boolean |
|---|---|---|
| Item A | 1 | yes |
| Item B | 0 | no |
| Item C | 5 | yes |
Converts numbers to booleans. Zero becomes false, non-zero becomes true.
Window functions
sum
Returns the sum of the given column or range. Range nomenclature: unbounded: null, current row: 0, previous row: -1, next row: 1.
Arguments
fieldField to aggregatesort_field(Optional) Field to sort bysort_direction(Optional) Sort direction ("asc"/"desc")range_start(Optional) Start index of range to sum over, relative to the current rowrange_end(Optional) End index of range to sum over, relative to the current rowgroup(Optional) Field to group by
Supported signatures
sum(Number | Float | Integer): Numbersum(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Numbersum(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Numbersum(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean): Numbersum(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String): Number
Example
Regional total: sum(prop("Revenue"), prop("Region"))
| Region | Product | Revenue | Regional total |
|---|---|---|---|
| North | Laptop | 3000.00 | 4500.00 |
| North | Mouse | 500.00 | 4500.00 |
| North | Monitor | 1000.00 | 4500.00 |
| South | Phone | 2000.00 | 3500.00 |
| South | Tablet | 1500.00 | 3500.00 |
| East | Desk | 1200.00 | 2000.00 |
| East | Chair | 800.00 | 2000.00 |
Shows total revenue per region. Each region's rows display the same regional total.
count
Returns the count of the given column or range. Range nomenclature: unbounded: null, current row: 0, previous row: -1, next row: 1.
Arguments
sort_field(Optional) Field to sort bysort_direction(Optional) Sort direction ("asc"/"desc")range_start(Optional) Start index of range to count from, relative to the current rowrange_end(Optional) End index of range to count to, relative to the current rowgroup(Optional) Field to group by
Supported signatures
count(): Integercount(String | Enum | Date | Number | Integer | Float | Boolean): Integercount(String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Integercount(String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Integer
Example
Orders per region: count(prop("Region"))
| Region | Product | Orders per region |
|---|---|---|
| North | Laptop | 3 |
| North | Mouse | 3 |
| North | Monitor | 3 |
| South | Phone | 2 |
| South | Tablet | 2 |
| East | Desk | 2 |
| East | Chair | 2 |
Shows number of orders per region. Each region's rows display the same count.
avg
Returns the average of the given values. Range nomenclature: unbounded: null, current row: 0, previous row: -1, next row: 1.
Arguments
fieldField to aggregatesort_field(Optional) Field to sort bysort_direction(Optional) Sort direction ("asc"/"desc")range_start(Optional) Start index of range to average over, relative to the current rowrange_end(Optional) End index of range to average over, relative to the current rowgroup(Optional) Field to group by
Supported signatures
avg(Number | Float | Integer): Numberavg(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Numberavg(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Numberavg(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean): Numberavg(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String): Number
Example
Regional average: avg(prop("Revenue"), prop("Region"))
| Region | Product | Revenue | Regional average |
|---|---|---|---|
| North | Laptop | 3000.00 | 1500.00 |
| North | Mouse | 500.00 | 1500.00 |
| North | Monitor | 1000.00 | 1500.00 |
| South | Phone | 2000.00 | 1750.00 |
| South | Tablet | 1500.00 | 1750.00 |
| East | Desk | 1200.00 | 1000.00 |
| East | Chair | 800.00 | 1000.00 |
Shows average revenue per region. Each region's rows display the same average.
range_min
Returns the minimum value of the given column or range. Range nomenclature: unbounded: null, current row:0, previous row: -1, next row: 1.
Arguments
fieldField to aggregatesort_field(Optional) Field to sort bysort_direction(Optional) Sort direction ("asc"/"desc")range_start(Optional) Start index of range to find the minimum value over, relative to the current rowrange_end(Optional) End index of range to find the minimum value over, relative to the current rowgroup(Optional) Field to group by
Supported signatures
range_min(String | Enum): Stringrange_min(Date): Daterange_min(Number | Float | Integer): Numberrange_min(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Stringrange_min(Date, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Daterange_min(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Numberrange_min(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Stringrange_min(Date, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Daterange_min(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Numberrange_min(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean): Stringrange_min(Date, String | Enum | Date | Number | Integer | Float | Boolean): Daterange_min(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean): Numberrange_min(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String): Stringrange_min(Date, String | Enum | Date | Number | Integer | Float | Boolean, String): Daterange_min(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String): Number
Example
Regional minimum: range_min(prop("Revenue"), prop("Region"))
| Region | Product | Revenue | Regional minimum |
|---|---|---|---|
| North | Laptop | 3000.00 | 500.00 |
| North | Mouse | 500.00 | 500.00 |
| North | Monitor | 1000.00 | 500.00 |
| South | Phone | 2000.00 | 1500.00 |
| South | Tablet | 1500.00 | 1500.00 |
| East | Desk | 1200.00 | 800.00 |
| East | Chair | 800.00 | 800.00 |
Shows minimum revenue per region. Each region's rows display the same minimum.
range_max
Returns the maximum value of the given column or range. Range nomenclature: unbounded: null, current row:0, previous row: -1, next row: 1.
Arguments
fieldField to aggregatesort_field(Optional) Field to sort bysort_direction(Optional) Sort direction ("asc"/"desc")range_start(Optional) Start index of range to find the minimum value over, relative to the current rowrange_end(Optional) End index of range to find the minimum value over, relative to the current rowgroup(Optional) Field to group by
Supported signatures
range_max(String | Enum): Stringrange_max(Date): Daterange_max(Number | Float | Integer): Numberrange_max(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Stringrange_max(Date, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Daterange_max(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Numberrange_max(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Stringrange_max(Date, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Daterange_max(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Numberrange_max(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean): Stringrange_max(Date, String | Enum | Date | Number | Integer | Float | Boolean): Daterange_max(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean): Numberrange_max(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String): Stringrange_max(Date, String | Enum | Date | Number | Integer | Float | Boolean, String): Daterange_max(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String): Number
Example
Regional maximum: range_max(prop("Revenue"), prop("Region"))
| Region | Product | Revenue | Regional maximum |
|---|---|---|---|
| North | Laptop | 3000.00 | 3000.00 |
| North | Mouse | 500.00 | 3000.00 |
| North | Monitor | 1000.00 | 3000.00 |
| South | Phone | 2000.00 | 2000.00 |
| South | Tablet | 1500.00 | 2000.00 |
| East | Desk | 1200.00 | 1200.00 |
| East | Chair | 800.00 | 1200.00 |
Shows maximum revenue per region. Each region's rows display the same maximum.
first_value
Returns the first value of the given column or range. Range nomenclature: unbounded: null, current row:0, previous row: -1, next row: 1.
Arguments
fieldField to aggregatesort_field(Optional) Field to sort bysort_direction(Optional) Sort direction ("asc"/"desc")range_start(Optional) Start index of range to find the minimum value over, relative to the current rowrange_end(Optional) End index of range to find the minimum value over, relative to the current rowgroup(Optional) Field to group by
Supported signatures
first_value(String | Enum): Stringfirst_value(Number | Float | Integer): Numberfirst_value(Date): Datefirst_value(Interval): Intervalfirst_value(Boolean): Booleanfirst_value(Object): Objectfirst_value(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Stringfirst_value(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Numberfirst_value(Date, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Datefirst_value(Interval, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Intervalfirst_value(Boolean, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Booleanfirst_value(Object, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number): Objectfirst_value(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Stringfirst_value(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Numberfirst_value(Date, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Datefirst_value(Interval, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Intervalfirst_value(Boolean, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Booleanfirst_value(Object, String | Enum | Date | Number | Integer | Float | Boolean, String, Number, Number, String | Enum | Date | Number | Integer | Float | Boolean): Objectfirst_value(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean): Stringfirst_value(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean): Numberfirst_value(Date, String | Enum | Date | Number | Integer | Float | Boolean): Datefirst_value(Interval, String | Enum | Date | Number | Integer | Float | Boolean): Intervalfirst_value(Boolean, String | Enum | Date | Number | Integer | Float | Boolean): Booleanfirst_value(Object, String | Enum | Date | Number | Integer | Float | Boolean): Objectfirst_value(String | Enum, String | Enum | Date | Number | Integer | Float | Boolean, String): Stringfirst_value(Number | Float | Integer, String | Enum | Date | Number | Integer | Float | Boolean, String): Numberfirst_value(Date, String | Enum | Date | Number | Integer | Float | Boolean, String): Datefirst_value(Interval, String | Enum | Date | Number | Integer | Float | Boolean, String): Intervalfirst_value(Boolean, String | Enum | Date | Number | Integer | Float | Boolean, String): Booleanfirst_value(Object, String | Enum | Date | Number | Integer | Float | Boolean, String): Object
Example
First order: first_value(prop("Product"), prop("Date"), "asc", null, null, prop("Region"))
| Region | Date | Product | First order |
|---|---|---|---|
| North | 2024-01-01 | Laptop | Laptop |
| North | 2024-01-03 | Mouse | Laptop |
| North | 2024-01-05 | Monitor | Laptop |
| South | 2024-01-02 | Phone | Phone |
| South | 2024-01-04 | Tablet | Phone |
| South | 2024-01-06 | Charger | Phone |
| East | 2024-01-02 | Desk | Desk |
| East | 2024-01-07 | Chair | Desk |
Shows the first product ordered in each region when sorted by date.
percentage
Returns the percentage (between 0 and 1) of the value in a row relative to the sum of the value in all rows. The optional second argument can be used to break up the rows into groups when calculating the percentage.
Arguments
valueValue to calculate the percentage ofgroup(Optional) Value by which to group the rows during calculation
Supported signatures
percentage(Number): Numberpercentage(Number, String | Enum | Boolean | Date): Numberpercentage(Float): Floatpercentage(Float, String | Enum | Boolean | Date): Floatpercentage(Integer): Integerpercentage(Integer, String | Enum | Boolean | Date): Integer
Example
Share: percentage(prop("Revenue"), prop("Region"))
| Account | Region | Revenue | Share |
|---|---|---|---|
| Acct 1 | North | 3000.00 | 0.75 |
| Acct 2 | North | 1000.00 | 0.25 |
| Acct 3 | South | 1500.00 | 0.60 |
| Acct 4 | South | 1000.00 | 0.40 |
offset
Returns the value of the given property offset from the current row by the given amount.
Arguments
fieldField to offsetoffsetOffset index (<0 will result in previous values, e.g. -2)sort_fieldField to sort bysort_directionSort direction ("asc"/"desc")group(Optional) Field to group by
Supported signatures
offset(String, Number, String | Enum | Date | Number | Integer | Float | Boolean, String?): Stringoffset(Enum, Number, String | Enum | Date | Number | Integer | Float | Boolean, String?): Enumoffset(Number, Number, String | Enum | Date | Number | Integer | Float | Boolean, String?): Numberoffset(Integer, Number, String | Enum | Date | Number | Integer | Float | Boolean, String?): Integeroffset(Float, Number, String | Enum | Date | Number | Integer | Float | Boolean, String?): Floatoffset(Boolean, Number, String | Enum | Date | Number | Integer | Float | Boolean, String?): Booleanoffset(Date, Number, String | Enum | Date | Number | Integer | Float | Boolean, String?): Dateoffset(String, Number, String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Stringoffset(Enum, Number, String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Enumoffset(Number, Number, String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Numberoffset(Integer, Number, String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Integeroffset(Float, Number, String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Floatoffset(Boolean, Number, String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Booleanoffset(Date, Number, String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Date
Example
Previous: offset(prop("Revenue"), -1, prop("Date"), "asc")
| Date | Revenue | Previous |
|---|---|---|
| 2024-01-01 | 1250.50 | |
| 2024-01-02 | 3420.00 | 1250.50 |
| 2024-01-03 | 890.25 | 3420.00 |
| 2024-01-04 | 2100.00 | 890.25 |
row_number
Returns the row number of the row in the current group.
Arguments
sort_field(Optional) Field to sort bysort_direction(Optional) Sort direction ("asc"/"desc")group(Optional) Field to group by
Supported signatures
row_number(): Integerrow_number(String | Enum | Date | Number | Integer | Float | Boolean): Integerrow_number(String | Enum | Date | Number | Integer | Float | Boolean, String): Integerrow_number(String | Enum | Date | Number | Integer | Float | Boolean, String, String | Enum | Date | Number | Integer | Float | Boolean): Integer
Example
Rank: row_number(prop("Revenue"), "desc", prop("Region"))
| Account | Region | Revenue | Rank |
|---|---|---|---|
| Acct 1 | North | 3420.00 | 1 |
| Acct 2 | North | 1250.50 | 2 |
| Acct 3 | South | 2100.00 | 1 |
| Acct 4 | South | 890.25 | 2 |
Utility functions
prop
Returns the value of the given property from the current row.
Arguments
propertyProperty to get the value of
Supported signatures
prop(String): Unknownprop(Reference): Unknown
variable
Returns the value of the given variable in the exploration.
Arguments
nameVariable name to get the value of
variable(String): Unknown
coalesce
Returns first non-null value in arguments.
Arguments
valueValue to return if all preceding values are null
Supported signatures
coalesce(String, [String, ...]): Stringcoalesce(Enum, [Enum, ...]): Enumcoalesce(Number, [Number, ...]): Numbercoalesce(Float, [Float, ...]): Floatcoalesce(Integer, [Integer, ...]): Integercoalesce(Number | Float | Integer, [Number | Float | Integer, ...]): Numbercoalesce(Boolean, [Boolean, ...]): Booleancoalesce(Date, [Date, ...]): Datecoalesce(Interval, [Interval, ...]): Intervalcoalesce(Enum, [Enum, ...]): Enumcoalesce(String | Enum, [String | Enum, ...]): String
format
Formats the value to the given format in the final output.
Arguments
fieldField to formatformatFormat to display in. For all numeric fields, can be one of "eur", "usd" or "gbp". Floating-point number fields also accept "percentage". For date fields, can be one of "iso", "date" or "time".precisionOptional. Displays the formatted value up to the given precision for Date fields and as the given precision for Integer fields. Can be one of "year", "quarter", "month", "week", "day", "hour", "day_of_week"
Supported signatures
format(String, String): Stringformat(Number, String): Numberformat(Float, String): Floatformat(Integer, String): Integerformat(Integer, String, String): Integerformat(Boolean, String): Booleanformat(Date, String): Dateformat(Date, String, String): Dateformat(Interval, String): Intervalformat(Enum, String): Enum
Example
Formatted: format(prop("Revenue"), "eur")
| Account | Revenue | Formatted |
|---|---|---|
| Acct 1 | 1250.50 | €1,250.50 |
| Acct 2 | 890.25 | €890.25 |
| Acct 3 | 3420.00 | €3,420.00 |
