Attributes
Attributes are one of the main building blocks of data models in Hashboard. They enable things like filtering and grouping when exploring your data.
You can setup and update attributes from the Add Data Model workflow.
Attributes can either be directly added based on a column on the underlying table or query, or you can write custom SQL attributes. The latter can be useful for things like combining pre-existing columns into something more useful, e.g. CONCAT(first_name, ' ', last_name)
.
Types
The following attribute types are supported in Hashboard:
Type | Description |
---|---|
Strings | Textual data like (names, emails, etc) |
Numbers | Numeric values (integers, decimals, etc) |
Dates | Time-based data (dates, timestamps, etc) |
Arrays | Collections of values |
Booleans | True/false values |
Configuration
Attributes can be configured with the following optional settings:
- Description: A readable description about the attribute - this will be surfaced when doing data explorations downstream. These can also be synced directly from your database.
- Alias: The persistent identifier for the column, corresponding to the "id" field in the DataOps Config of the attribute.
- Primary date: This can be set on date attributes - it will be used throughout Hashboard as the default for time-based data explorations of your model.
- Primary key: This can be set on any unique string or numeric attribute to enable joining to another model. See Model Joins for more info.
- Binning: A default bin width for the attribute - when doing data explorations, this will be used to automatically group numeric values into buckets.
- Make attribute hidden: When selected, this attribute will be hidden by default from the attribute tray.
Custom SQL Attributes
To add a custom SQL attribute:
- Create or edit the Data Model that you want to add the custom attribute to.```
- Under the Attributes section click the
+ Add Custom Attribute
button. - Enter your selection SQL and click the 🔄 button to test the SQL.
Deriving attributes from other attributes
Custom attributes can refer to other attributes to avoid duplicating logic.
UPPER({{ city_attribute }})
SQL can reference other attributes by surrounding their alias
in double curly braces. When querying, Hashboard will expand references to their full definitions.
Using joined columns in custom SQL
See Using Joined Columns in Custom SQL for more info.