Articles in this section
Category / Section

Dynamic Time Series analysis using Chart widget in Bold BI

Published:

This article explains how to dynamically switch values in a chart based on a combo box selection using dashboard parameters and expressions concepts in Bold BI®.

Use Case:

In this use case, we will show the Sales data with different time periods: Yearly, Monthly, and Daily. You can modify these values to fit your specific needs. The user will be able to select from these time periods through a combo box, allowing for dynamic changes in the data visualized on the dashboard.

Step-by-Step Guide to Dynamic Chart Configuration in Bold BI®:

Step 1: Create a Parameter in Bold BI
  1. Navigate to the Data Source Designer page of your dashboard and locate the Dashboard Parameters section.
  2. Create a String Type parameter and select the mode as List.
  3. Add values manually: Yearly, Monthly and Daily
    image.png

    image.png

Note: When using the List Mode, set the Default value when using the dashboard parameter in the same data source.

Step 2: Add the Parameter to the Combo Box
  1. Drag and drop a Combo Box widget onto your dashboard
  2. Configure the created dashboard parameter in the Combo Box widget.
    image.png
Step 3: Create Expression to Format Created Date for the Chart

Columns Expression:

This below expression dynamically formats the CreatedDate based on the selected parameter value, returning the year for ‘Yearly’, the month and year for ‘Monthly’, and the full date as a string for ‘Daily’.

CASE
   WHEN @{{:Parameter1}} = 'Yearly' THEN CAST(YEAR([CreatedDate]) AS VARCHAR)
   WHEN @{{:Parameter1}} = 'Monthly' THEN FORMAT([CreatedDate], 'MMM yyyy') 
   WHEN @{{:Parameter1}} = 'Daily' THEN CAST([CreatedDate] AS VARCHAR) 
END 

Note: Replace @{{:Parameter1}} with the parameter you created.

Step 4: Bind the Expressions to the Chart
  1. Drag and drop a Chart Widget.
  2. Use the SalesDetails for the Y-axis.
  3. Use the Columns expression(Time Series Analysis) for the X-axis.
    image.png
Step 5: Preview to Time Series Analysis Data:
  1. Change the value in the Combo Box.
  2. The chart should update dynamically based on the selected time period (Yearly, Monthly and Daily).
    image.png

    image.png

    image.png

    By following this guide, you can easily configure a dynamic chart in Bold BI® that updates based on a user’s selection from a Combo Box. This approach allows you to display sales data in various time periods (Yearly, Monthly, and Daily), giving users a flexible and interactive way to analyze trends and make data-driven decisions.
Additional References
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
TV
Written by Thulasi Venkatesan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied