12.3. Properties of Parameters
Parameters are an essential part of Looker Studio that make your reports interactive and dynamic. Let's explore the properties of parameters and how they can be utilized effectively.
- Understand the key properties of parameters in Looker Studio.
- Learn how to create and define user parameters within a data source.
- Utilize controls to receive user input for parameters.
- Implement parameters in different use cases, such as calculations and dynamic queries.
- Create more interactive and dynamic reports using parameters.
The Anatomy of a Parameter
There are several key properties that define a parameter:
- Name: Just like any other field, parameters have names. These are usually user-facing so that users can easily identify them.
- Type: Parameters can be of different types, such as text-based, numeric (decimal or whole), or boolean (true/false).
- Range: For each parameter, you can define a range to limit the input. This acts as validation, ensuring that users only input values within a specified range.
- Allowed Values: In some cases, you may want to restrict the parameter input to specific values, such as 10, 20, 30, 40, or 50. This can be useful for custom formulas or specific use cases.
- Default Value: Parameters can have default values that are set when the report loads, before users have a chance to input their own values.
Creating and Using Parameters
To create a user parameter, you first need to define the parameter within the data source. Parameters are part of data modeling, and they must be defined along with their type, allowed values, and default value.
Once the parameter is defined, you need a way to allow users to input values. This is where controls come in. Controls, like input boxes, enable users to provide values for the parameters. These values can be used in various ways:
- Display the value directly on a chart
- Incorporate it into calculations
- Use it in a dynamic BigQuery custom query
Example: Let's say you have an e-commerce dataset and you want to allow users to filter the revenue data based on a specific date range. You could create a date parameter and use a date range control to receive the user input. Then, you could use this parameter in a dynamic query to display the revenue data for the selected date range.
Now that you have a better understanding of parameters and their properties, you can start creating more interactive and dynamic reports in Looker Studio.