Skip to main content

boolean

Definition

A boolean is used whenever you have a column or SQL expression that returns True/False, i.e. Yes/No.

Usage

You may have a column that says whether an order was returned ('yes') or not ('no'). Veezoo will automatically recognize this column to be a boolean and define it like this:

import: [
db.postgres.movie_db.public.ORDERS
]

kb {

class Order {

...

boolean Returned {
name.en: "Returned"

sql: "${ORDERS.returned} = 'yes'"
}
}
}

For boolean, the sql is any kind of SQL boolean expression.

As another example, let's say we have a dataset with flights, including their origin country and destination country.

We could define a flight to be domestic using boolean like this:

import: [
db.postgres.flights_db.public.FLIGHTS
]

kb {

class Flight {

...
boolean is_Domestic {
name.en: "Domestic"

sql: "${FLIGHTS.from_country} = ${FLIGHTS.to_country}"
}
}
}