Skip to Content
Data StudioFormulas

Formulas

Calculate a computed property from other properties with a formula: syntax, operators and functions.

Last reviewed September 28, 2026

A formula calculates one value from other properties of the same event, user or table row. For example, revenue - cost gives the margin of each order.

A formula cannot join tables or add up values across rows. For that, write a SQL model in Studio.


Create a formula

  1. Go to Data → Computed Properties.
  2. Click New Property.
  3. Select what the property describes: Events, User properties or Custom table. Click Continue.
  4. In Type, select the Formula option.
  5. For events, select the event in On event. Other events get no value. Select Any event to calculate the value for every event.
  6. Write the formula, or click Ask AI (see below).
  7. Click Create property. When you edit a formula later, click Save changes.

Vendo checks the formula while you type. If the formula is correct, the editor shows its Result type: Number, Text, True / false or Date. If it is not correct, the editor shows the problem and where it starts.


Insert a property

Type / where a value can go: at the start, after an operator, after ( or after ,. A list of the properties opens. Type to filter the list, then press Enter or Tab to insert the property. Press Esc to close the list.

After a value, / divides. For example, in revenue / the / divides and the list does not open.

You can also click a property below the editor to insert it.


Write a formula with Ask AI

  1. Click Ask AI on the Formula card. The AI panel opens next to the editor.
  2. Describe the calculation in plain English. For example: “Margin as a percentage of revenue, rounded to one decimal place”.
  3. The AI writes a formula with the properties of your workspace. Vendo checks the formula before it shows it to you.
  4. Click Apply to put the formula in the editor.
  5. Click Create property or Save changes to save the property.

Nothing is saved until you click Create property or Save changes. If you change the formula after the AI writes it, Apply does not work and the proposal shows Not applied. Ask the AI again.


Syntax

WriteMeaningExample
A property nameThe value of that propertyrevenue
A name in backticksA property name that has spaces or other characters`order total`
Text in single quotesA text value. Write '' for a quote inside the text'paid', 'it''s'
A numberA number value100, 0.5
true, falseTrue or falsetrue
nullNo valuenull
( … )Calculate this part first(revenue - cost) / revenue

A formula can have up to 2,000 characters.


Operators

OperatorMeaningExample
+ - * /Add, subtract, multiply, divide. Division by zero gives no valuerevenue / quantity
= !=Equal, not equal. == and <> also workstatus = 'paid'
< <= > >=Less than, greater thanrevenue > 100
and or notCombine true/false valuesrevenue > 100 and not refunded

Vendo calculates in this order: * and /, then + and -, then comparisons, then not, and and or. Use parentheses to change the order.


Functions

FunctionResult
round(number, digits)Rounds the number. Without digits, rounds to a whole number. digits is a whole number from 0 to 10
floor(number)Rounds down
ceil(number)Rounds up
abs(number)The value without its sign
min(a, b, …)The smallest number
max(a, b, …)The largest number
if(condition, then, else)then when the condition is true, else else
coalesce(a, b, …)The first value that is not empty
days_between(start, end)The number of whole days from start to end
now()The current time
lower(text)The text in lower case
upper(text)The text in upper case
trim(text)The text without spaces at the start and end
length(text)The number of characters
concat(a, b, …)The values joined as text
contains(text, part)True when text contains part

Values and types

  • Vendo converts a property to the type that the formula needs. For example, in revenue - cost both properties become numbers.
  • If a value cannot be converted, the result is empty. For example, the text n/a gives no number.
  • A comparison uses the type of the side that is clear. In revenue > 100 both sides are numbers. If no side is clear, Vendo compares them as text.
  • A formula that is only a property name gives text.

Examples

FormulaResult
revenue - costThe margin
round((revenue - cost) / revenue * 100, 1)The margin as a percentage, with one decimal place
days_between(signup_date, first_order_date)The days from sign-up to the first order
if(revenue > 100, 'high', 'standard')A value tier
coalesce(utm_source, 'direct')The source, or direct when there is none
lower(trim(country))The country, cleaned

Need help?

When you contact support, give your workspace, the source or destination name, the job ID and the first error message.

support@vendodata.com
Last updated on