Changing Labeling on X-Axis of Chart that Is Grouped by Period
Hello,
I am creating a line chart with three categories and looking back 13 months and 13 weeks. My question is how can I get the x-axis labels for both month and week to show something different.
For example, I created a dummy chart that shows the freethrow percentages of a basketball time that I manage in the land of make-believe. The chart shows the aggregated percentages of the freethrows for the top, bottom, and average performer for the previous 13 months. I have created the same chart for the previous 13 weeks. My question in this example is how do I change the month/weeks labels on the x-axis to something more user-friendly to me. It is especially hard looking back 3 weeks and seeing 'Week [X]' and not knowing how to interpret what it means. Ideally, I would like to show a date of some sort so that the chart makes more sense to me.
I have attached some screenshots detailing the solution that I am hoping for.
Best Answer
-
You can construct your own week text with a beast mode and put that field in your x-axis. Something like this:
CONCAT('Week of ', DATE_SUB(
dt
, INTERVAL (DAYOFWEEK(dt
) - 1) DAY) )**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0
Answers
-
You can construct your own week text with a beast mode and put that field in your x-axis. Something like this:
CONCAT('Week of ', DATE_SUB(
dt
, INTERVAL (DAYOFWEEK(dt
) - 1) DAY) )**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Thanks for the answer! Can you show me where to put the beastmode exactly?
0 -
You would click on Calculated Field
Write your beast mode and name it
Drag that field into the x-axis
Hope that helps.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Hi Mark, I have one final question. I am trying to change the date format to Month/Day/Year but when I do so, the datatype turns into a string in the ordering is out of whack. What should I do to alleviate this issue? Thank you!
0 -
You will want to create a 2nd beast mode that you would use just for sorting purposes. Just make sure it results in the same granularity as the field you have in the x-axis. You might be able to just create a beast mode that is just WEEK(dt) and put that in the sorting.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
That worked perfectly. Huge kudos to you and I hope you have a wonderful weekend :)
1 -
I keep trying to do this, but I keep getting this error:
Any chance you can help @MarkSnodgrass
0 -
@emaynez it looks like dt is not an actual field in your dataset. Replace dt with the date field that you want to use, and see if it validates.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Got it! Thank you so much!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive