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.
- Format: Applies only to numeric type attributes. Select your preferred formatting for numeric values.
- 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.
Attribute folders
You can organize your attributes into folders to keep your data model tidy and easy to navigate.
To organize your attributes and measures into folders in a data model:
- Open the data model in the Model builder.
- Select the attribute you want to move to a folder.
- In the attribute configuration pane, locate the
Folder
input field. - To move an attribute into an existing folder, select the folder in the dropdown. To create a new folder, type the desired name into the search input and click the option to
Add
a new folder with that name. - Repeat steps 2-5 for each attribute you want to organize into a folder.
- Once you’re finished, save the data model.
- Start exploring the data model, and you’ll see your folders in the Data tray.