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
- 10.5K All Categories
- 8 Connect
- 918 Connectors
- 250 Workbench
- 473 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 478 Datasets
- 211 Visualize
- 257 Beast Mode
- 2.1K Charting
- 12 Variables
- 18 Automate
- 355 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 247 Distribute
- 63 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 183 Product Ideas
- 1.2K Ideas Exchange
- 11 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive