What is lightdash.config.yml?
Thelightdash.config.yml file is an optional configuration file that allows you to define project-wide settings for your Lightdash project. Think of it as a way to customize and enhance your Lightdash experience beyond the basic setup.
Do I need this file?
You don’t needlightdash.config.yml to get started with Lightdash! This file is for users who want to:
- Organize metrics in Spotlight with custom categories and visibility settings
- Create parameters that users can change to modify data across multiple charts and dashboards
Getting started
Before creating alightdash.config.yml file, make sure you have:
- ✅ A working Lightdash project (completed the getting started guide)
- ✅ A local dbt project (not connected to dbt Cloud)
- ✅ The Lightdash CLI installed and configured
Create the file
Create a new file called
lightdash.config.yml in the root directory of your dbt project - this is the same folder where your dbt_project.yml file is located.Add your first configuration
Start with a simple configuration. Here’s a basic example that sets up Spotlight categories:
Configuration options
Thelightdash.config.yml file supports the following top-level configuration options:
Spotlight configuration
Thespotlight section allows you to configure project-wide spotlight settings. This section is required in the lightdash.config.yml file.
| Property | Required | Value | Description |
|---|---|---|---|
default_visibility | No | string enum | The default visibility of spotlight metrics. Defaults to show, can also be set to hide. |
categories | No | Object | Define the categories that can be used in Spotlight on your model yml files. |
categories object requires the following properties:
| Property | Required | Value | Description |
|---|---|---|---|
label | Yes | string | The label of the category as it will be displayed in Spotlight. |
color | No | string enum | The color of the category. If not provided, it will be set to gray. Allowed values: gray, violet, red, orange, green, blue, indigo, pink, yellow. |
Parameters configuration
Theparameters section allows you to define project-wide parameters that can be referenced in various parts of your Lightdash project.
| Property | Required | Value | Description |
|---|---|---|---|
label | Yes | string | A user-friendly label for the parameter as it will be displayed in the UI. |
description | No | string | A description of the parameter. |
type | No | ”string”, “number”, or “date” | The type of the parameter. Defaults to “string” if not specified. |
options | No | Array of strings or numbers | A list of possible values for the parameter. |
default | No | string, number, or Array of strings/numbers | The default value(s) for the parameter. |
multiple | No | boolean | Whether the parameter input will be a multi-select. |
allow_custom_values | No | boolean | Whether users can input custom values beyond predefined options. |
options_from_dimension | No | Object | Get parameter options from a dimension in a model. Requires model and dimension arguments (see below). |
options_from_dimension, the object requires the following properties:
| Property | Required | Value | Description |
|---|---|---|---|
model | Yes | string | The model containing the dimension. |
dimension | Yes | string | The dimension to get options from. |
Using parameters in your project
Parameters defined in thelightdash.config.yml file can be referenced in various parts of your Lightdash project using the syntax ${lightdash.parameters.parameter_name} or the shorter alias ${ld.parameters.parameter_name}.
For example, to reference a parameter named region:
Defaults configuration
Thedefaults section allows you to set project-wide default settings that apply across all explores and dimensions. These defaults can be overridden at the explore or dimension level.
| Property | Required | Value | Description |
|---|---|---|---|
case_sensitive | No | boolean | Default case sensitivity for string filters across the project. When false, all string filters will be case insensitive by default. Defaults to true. |
Case sensitivity hierarchy
Thecase_sensitive setting follows a hierarchy where more specific settings override broader ones:
- Dimension-level (highest priority) - Set on individual dimensions
- Explore/table-level - Set on the explore or table
- Project-level - Set in
lightdash.config.ymldefaults - Default behavior - Case sensitive (
true) if nothing is specified
See Tables reference for explore-level configuration and Dimensions reference for dimension-level configuration.
Custom granularities configuration
Availability: Custom granularities are an Early Access feature.
custom_granularities section allows you to define reusable custom time granularities that appear in the date zoom dropdown alongside standard options (Day, Week, Month, Quarter, Year). This is useful for business-specific time periods like fiscal quarters, Monday-to-Sunday weeks, or other custom date groupings.
| Property | Required | Value | Description |
|---|---|---|---|
label | Yes | string | A user-friendly label for the granularity as it will be displayed in the date zoom dropdown. |
sql | Yes | string | SQL expression that defines how to truncate/transform the date. Use ${COLUMN} as a placeholder for the actual date column - it will be replaced with the column’s SQL at runtime. |
type | No | date, timestamp, or string | The output type of the SQL expression. Use date for truncated dates, timestamp for truncated timestamps, or string for formatted text output (e.g., fiscal year labels). Defaults to date if not specified. |
How custom granularities work
Custom granularities are defined at the project level inlightdash.config.yml and become available on date dimensions through the time_intervals property. The ${COLUMN} template in the SQL expression is automatically replaced with the actual column SQL when generating queries.
Example: Define a fiscal quarter granularity and use it on a dimension:
fiscal_quarter will now appear in the date zoom dropdown for order_date, alongside the standard intervals.
Custom granularities inherit
requiredAttributes and anyAttributes from the parent dimension, so access controls are automatically applied.Use cases
- Fiscal calendars: Define fiscal quarters or years that don’t align with calendar quarters
- Week start customization: Create weeks that start on Monday or any other day
- Custom periods: Define business-specific time periods like “retail weeks” or “academic terms”
See Dimensions reference for more information on configuring time intervals on dimensions, including how to reference custom granularities.