Rearrange values on X axis
Hi,
I am creating a view where I want to observe volumes base on a time of the day bucket. So have a variable: time_of_the day that I created using a timestamp variable. When I put the variable on the x axis, it starts with 10-11 AM first and and with the earliest value, 9-10 AM. I would like to organize the values in a way that it starts with 7-8AM though. How can I solve this problem?
Best Answer
-
No, you'd have two separate beast modes. One for your values and another for your sorting.
Bucket:
case when timestamp_var::time between '07:00:00' and '08:00:00' then '7-8 AM'
Sort:
case when timestamp_var::time between '07:00:00' and '08:00:00' then 1
Although now seeing your beastmode - are you just breaking it down into hour buckets?
You could possibly just do something like to do the sorting or even buckets if you don't care about AM/PM and can use 24-hour format:
HOUR(timestamp_var::time)
Are you doing this within a beast mode or in the sql query which pulls in the data?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2
Answers
-
Hi @user084060
If you want to do some custom sorting you can utilize the same methodology you're using to create your buckets by assigining values via a case statement (such that your first bucket would be 1, second is 2 etc) and then use that beast mode as a sort on your card.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Hi @GrantSmith ,
So instead of just creating
case when timestamp_var::time between '07:00:00' and '08:00:00' then '7-8 AM'
put a 1 infront of it?
when fact.start::time between '07:00:00' and '08:00:00' then '1_7-8 AM'
If that works, it's definitely an option, I just hoped there is another (easier) way ?
0 -
No, you'd have two separate beast modes. One for your values and another for your sorting.
Bucket:
case when timestamp_var::time between '07:00:00' and '08:00:00' then '7-8 AM'
Sort:
case when timestamp_var::time between '07:00:00' and '08:00:00' then 1
Although now seeing your beastmode - are you just breaking it down into hour buckets?
You could possibly just do something like to do the sorting or even buckets if you don't care about AM/PM and can use 24-hour format:
HOUR(timestamp_var::time)
Are you doing this within a beast mode or in the sql query which pulls in the data?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2 -
Also based on your current logic if the timestamp fell exactly on 8:00:00 AM your code would cause it to always fall within the 7-8AM bucket and not the 8-9am bucket. You might want to change your BETWEEN to use '07:59:59' instead of '08:00:00' since BETWEEN is inclusive.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
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
- 101 SQL DataFlows
- 623 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 748 Beast Mode
- 60 App Studio
- 41 Variables
- 690 Automate
- 177 Apps
- 455 APIs & Domo Developer
- 48 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 397 Distribute
- 114 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 127 Manage
- 124 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 109 Community Announcements
- 4.8K Archive