How to Use Parameters in Looker Studio

Parameters in Looker Studio allow you to create dynamic and interactive reports by letting users control and modify the values used in calculations or visualizations. Parameters are particularly useful when you want to give your report viewers the ability to input their own values, which can then be used in calculated fields, filters, or custom metrics.

Here’s a step-by-step guide on how to use parameters in Looker Studio:

Step-by-Step Guide to Using Parameters in Looker Studio #

1. Open Your Report and Access the Data Panel #

  • Start by opening the report where you want to add a parameter.
  • Ensure your data source is connected and available in the Data Panel on the right-hand side of the screen.

2. Add a Parameter #

  • In the Data Panel, scroll down to the Parameters section, which you can find near the bottom of the field list.
  • Click the + Add a Parameter button to create a new parameter.

3. Configure the Parameter #

  • A new window will pop up where you can define the details of your parameter. The key fields to configure are:
    • Parameter Name: Give your parameter a descriptive name that reflects its purpose (e.g., "Discount Rate," "Target Sales").
    • Parameter ID: This is an internal identifier for the parameter, and it is automatically filled based on the name you provide.
    • Data Type: Select the type of data the parameter will accept. Options include:
      • Text: If you expect users to enter text values.
      • Number: If the parameter will involve numeric values.
      • Boolean: For true/false conditions.
      • Date: If users will select a date.
    • Allowable Values: You can define whether users can enter Any Value or select from a List of Values that you predefine.
      • Any Value: Allows free input, such as any number or string.
      • List of Values: Limits users to a dropdown selection. You specify the values they can choose from (e.g., 5%, 10%, 15%).

4. Use the Parameter in a Calculated Field #

  • Once your parameter is set up, you can use it in a calculated field to dynamically change the results based on user input.
  • To do this, go to the Data Panel, click + Add a Field to create a new calculated field, and use the parameter in the formula.

Example: Dynamic Discount Calculation #

If you want to allow users to input a discount rate that dynamically affects the displayed sales numbers, you can create a parameter for the discount and use it in a calculated field.

  1. Step 1: Create a Parameter called "Discount Rate" and set it as a Number with values like 0.05 (5%), 0.10 (10%), etc.
  2. Step 2: Create a Calculated Field that applies this discount to the sales data. The formula might look like this:
    Discounted Sales = Sales * (1 - Discount Rate)
  3. Step 3: Add this calculated field to your chart or table.

5. Add the Parameter Control to Your Report #

  • Once your parameter and calculated field are set up, you’ll need to add a control to allow users to change the parameter value.
  • Go to the top menu and click Add a Control > Input Box or Dropdown List depending on how you want users to input the parameter value.
  • Drag the control onto your report canvas.
  • In the control's Data Panel, under the Control Field section, select the parameter you created (e.g., "Discount Rate").

6. Test the Parameter #

  • Switch to View Mode by clicking the View button in the top-right corner.
  • Use the input control to change the value of the parameter, and watch how the data in your chart or table updates dynamically based on the new parameter value.

Example Use Cases for Parameters #

  1. Dynamic Target Setting:
    Allow users to set sales or performance targets and see how the data compares to those targets.

    • Create a parameter called "Target Sales."
    • Create a calculated field like:
      Performance vs Target = Sales - Target Sales
  2. Custom Date Ranges:
    Let users select a specific date or date range to dynamically filter the data displayed.

    • Create a parameter for "Start Date" and "End Date."
    • Use these parameters in calculated fields to display only data within the selected date range.
  3. Scenario Analysis:
    Use parameters for “what-if” analysis, allowing users to input different scenarios and see how key metrics (like revenue or profit) change.

    • For example, create a parameter called "Price Increase" and use it in a formula like:
      New Revenue = Revenue * (1 + Price Increase)
  4. Filtering by Category:
    Create a dropdown parameter that allows users to filter a table by a product category, country, or any other dimension.

    • Define a parameter with a list of categories or values.
    • Use the parameter in a calculated field like:
      CASE
      WHEN Category = Parameter_Category THEN Sales
      ELSE 0
      END

Tips for Using Parameters in Looker Studio #

  1. Use Descriptive Names: Give your parameters clear names so users understand what they control.

  2. Provide Clear Instructions: If your parameter is complex or might be confusing, add a description or label on your report to explain what the parameter does and how it affects the data.

  3. Restrict User Input: If you want to avoid invalid inputs (e.g., non-numeric values where numbers are required), restrict the parameter to a predefined list of values rather than allowing free input.

  4. Test with Different Values: Before publishing the report, test the parameter control with different inputs to ensure the calculations and updates are working as expected.

  5. Combine Parameters with Filters: You can use parameters alongside filters to create more dynamic interactions. For example, users could set a parameter for a custom target and use filters to drill down by region or category.

Conclusion #

Using parameters in Looker Studio allows you to add an interactive and dynamic element to your reports. Whether you’re creating customized targets, dynamic calculations, or scenario analyses, parameters give users control over key values in real-time, making your reports more engaging and useful. By integrating parameters with calculated fields and filters, you can create highly flexible reports that adapt to different user needs.

For more advanced customization, you can also explore how to use calculated fields in Looker Studio or how to add formula fields to extend the functionality of your reports.

Published