12.5. Parameters - Range of Values
Using Sliders for Numeric Parameters
In this lesson, we will explore how to use a slider as an input method for a numeric parameter with a specified range. Unlike the previous example, which allowed users to input any number within a range, this method offers a more visually appealing and intuitive way for users to select values.
- Understand the use of sliders as an input method for numeric parameters with a specified range.
- Learn how to customize sliders to improve the user experience, such as setting step size and displaying tick marks.
- Recognize when to use sliders and when to use input boxes based on the client's needs for precision and ease of use.
Consider a parameter representing the average profit margin, which is a decimal number between 0 and 1. In this case, we cannot have a profit margin greater than 100% for a product. The default value for this parameter is set to 0.12.
Advantages of Sliders
Instead of using an input box, which may cause confusion for users who are unsure of the valid input range, we can use a slider. The slider provides a clear visual indication of the permitted range of values, reducing the chance of user error.
When you have a parameter with a defined minimum and maximum, the slider is an excellent choice, as it helps users understand the allowed values easily. Additionally, you can customize the slider's step size and decide whether to display tick marks, further enhancing the user experience.
For example, if you set the step size to 0.1 and enable tick marks, users can see the available values they can select. However, this means they cannot input precise values like 0.12 or 0.15, as the steps are limited to increments of 0.1.
In real-life applications, using sliders can be particularly helpful for clients who want to quickly adjust values in their data models and see the results. This feature allows them to interact with their data and gain insights more efficiently.
When to Use Sliders
Sliders are ideal when you have a numeric parameter with a defined range and when you want to provide users with a clear indication of the allowed values. However, if you know that the client wants to input precise values, you might consider using an input box instead.
In conclusion, sliders provide a more user-friendly and visually appealing way to input numeric parameters within a specified range. They help prevent user errors and improve the overall experience of interacting with data models in Looker Studio.