Time Trends - How to switch time intervals from Day to Month to Year
This guide assumes that you’ve already worked through our 5-min Quickstart guide. If you haven’t yet completed it on your own, please do so first:
5-min Quickstart - Create a new dashboard and your first three widgets
In this guide, you’ll learn how to toggle time intervals (Days, Months, Years) on the same widget, like this:
Let’s start by building out a line chart, and then we’ll add in the time-switching capabilities.
Create a Line Chart with a Time Dimension
You need a widget that measures something over a period of time.
For this example, we’ll stick to simply trending your Good Parts over time.
Select Add Widget, and then select Advanced Configuration.
2. Open the widget dropdown menu and select Line Chart. For your X-Axis, Add and select “Calendar DateTime”
3. Click the “Y” icon next to Calendar DateTime and change the intervals to Days.
4. In your Values panel, click Add, and then search and select “Good Production”
You should now have a Time-Series line chart that shows your good output over the course of time.
Note: We are using demo data for this tutorial, which is why our screenshot above has a strange spike in it.
🕵️ If you look closely at your line chart, you’ll notice that the horizontal line (x-axis) is in Day intervals.
This works when you want to analyze a couple weeks or a single month. But what if you want to trend the last 6 months? Or the last 2 years?
First, name this line chart “Production Trend” like in the screenshot below.(this step is important for the next section. You can name it anything you want, just make sure it’s easy to remember!):
Add a Dimension-Changer and Configure it to your Line Chart
We’ll need to create the ability to quick toggle between time intervals.
You can accomplish this with the Dimension-Changer tool.
Select Add Widget, and then select Advanced Configuration.
2. Open the widget dropdown and select “Dimension Changer”.
3. In the “Rows” panel, search and select “Calendar DateTime”
Think of “Calendar DateTime” as a timestamp that can be converted to whichever time interval you prefer (Hours, Days, Weeks, Months, Years, etc.).
The only thing you need to do is tell our Analytics portal how you’d like Calendar DateTime to display.
You should now see the following in your Rows panel:
Next, we will duplicate “Calendar DateTime” so that we have different intervals (Year, Month, Day) to toggle.
4. In the same screen, right-click on “Years in Calendar DateTime“ and select Duplicate.
Right-click again, and Duplicate a second time (you should have 3 identical measures now).
5. Click the “Y” icon on the second measure, and change it to Months.
6. Do the same with the third measure, except this time, select Days.
Your screen should now look like this:
Connect the Dimension-Changer with your Line Chart
On the right-side of your Dimension-Changer is a “Design” tab.
Click Add + and then select the name of the trend chart (“Good Production Trend”) that you made earlier.
2. In the Dimension Index, set it to “0”, and in the Panel to Change, type “X-Axis” (case-sensitive).3. Click “Apply” to save your changes
Your dashboard should have a horizontal tab that shows the time interval toggles you just made.
Congratulations! 🙌 You made a dynamic time changer!
Click through each of these items to change the time intervals of your widget.