Data Types
When writing formulas in Tabmega, it’s important to understand the concept of data types.
You might have already noticed that the column headers in Tabmega are not letters like A, B, C in Excel and Google Sheets. Instead each column has a descriptive name, such as movieId
. Each column also has an icon such as or . If we hover over these icons we can see it corresponds to the data type of the column, such as Integer type or Text type:
Column data types impose more structure on your data - for example you can’t have text values in an integer column. This makes Tabmega less flexible than traditional spreadsheets, where any cell can have any type of value. However this unlimited flexibility of traditional spreadsheets is one of the main reasons Excel and Google Sheets have row limits. By requiring more structure Tabmega is able to scale to much larger datasets.
In addition to scaling to bigger data, column data types have other benefits like keeping your data clean and organized. In fact, Excel and Google Sheets have a feature called Tables that puts data types on your columns in those products. They don’t get rid of the row limits, but they do help keep your data more organized and clean than regular spreadsheets.
List of data types
Name | Column Icon | Values |
---|---|---|
BOOLEAN | TRUE and FALSE ) | |
DATE | Calendar date (year, month day) such as 2024-01-05 | |
DECIMAL | Number with decimal such as 1.291 . For more technical users, this is a double precision floating-point number. | |
INTEGER | Positive and negative integers, including zero, such as 42 . For more technical users this is a signed eight-byte integer. | |
TEXT | Variable-length character string such as "example" | |
TIMESTAMP | Combination of time and date. The values are always displayed in UTC time zone, such as 2023-12-28 02:15:00 UTC . |
Blank values
All columns in Tabmega can have blank values. You can test if a cell is blank with the ISBLANK
function. For users interested in the implementation, blank cells are equivalent to NULL values in the underlying DuckDB implementation.
Name | Description |
---|---|
ISBLANK(value) | Whether the value is empty (aka null). |
ISBLANK(value)
Whether the value is empty (aka null).
Data type conversion functions
Name | Description |
---|---|
DATE(year, month, day) | Convert a provided year, month, and day into a date. |
TIMESTAMP_FROM_MILLIS(milliseconds) | Converts the number of milliseconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP |
TIMESTAMP_FROM_TEXT(text_representation) | Converts a text representation in the form YYYY-MM-DD HH:MM:SS.[zzz]+-TT[:tt] ” + “to a timestamp. +-TT[:tt] is the offset from UTC and is required. |
TO_DECIMAL(value) | Converts integer or text to decimal type. |
TO_INTEGER(value) | Converts decimal or text to integer type. Decimals are rounded down. |
TO_TEXT(value) | Converts any value to text type |
DATE(year, month, day)
Convert a provided year, month, and day into a date.
TIMESTAMP_FROM_MILLIS(milliseconds)
Converts the number of milliseconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP
TIMESTAMP_FROM_TEXT(text_representation)
Converts a text representation in the form YYYY-MM-DD HH:MM:SS.[zzz]+-TT[:tt] ” + “to a timestamp. +-TT[:tt] is the offset from UTC and is required.
TO_DECIMAL(value)
Converts integer or text to decimal type.
TO_INTEGER(value)
Converts decimal or text to integer type. Decimals are rounded down.
TO_TEXT(value)
Converts any value to text type