Best Of
Re: Show Headcount based on Date Range Selected
Hello Ankur!
A Beastmode might be an unnecessary solution here.
You can set the "Geo" (or other categorical data) on the X Axis and the "Count" of a date on your Y Axis.
You can then select whatever date you want in the date selection of the Chart itself.
This will default the date range for an untouched card.
Then, you can create a filter card to allow end users to select the date that they want to look at. This filter card does not need to be powered off a Beastmode, but rather can use the same data that is powering the output chart.
NB: If you date data is at a daily level but you want filtering ability at the month level, then a simple Beastmode can group those dates up to the month level, like so:
MONTH(`Date`)
Selecting default date range on chart:
Slicer/Filter using date field:
Re: How to fill-down nulls from earliest instance of non-null value?
Hi @alzwang99,
You can do it with a simple Python tile and the following single line code (bold):
#Import the domomagic package into the script
from domomagic import *
#read data from inputs into a data frame
input1 = read_dataframe('your_previous_tile_name')
#write your script here
input1['ID'] = input1['ID'].map(lambda x: None if not x else x).fillna(method='ffill')
#write a data frame so it's available to the next action
write_dataframe(input1)
Re: World Map Visual
@cmarino The country values in your data likely don't match the format that Domo is expecting for that chart type. According to this KB article, the World Map chart matches the data to the country based on the country's 2-character ISO country code. Here is a Wikipedia article with the list of countries by ISO code:
Re: Option to allow the "Filter Bar" be visible by default
The filter bar always stayed visible by default up until a few days ago. I hope this is just a bug and not an intentional change.
DP22 - Using Beast Mode to Build Data Storytelling - Formatted Time Duration
This post is part of a series of beast modes I presented on during my “Using Beast Mode to Build Data Storytelling” Domopalooza 2022 session. If you find this post helpful please make sure to give it a like or an awesome below.
Use Case
We wanted a way to display how long an invoice took to process in a more human readable format. Instead of displaying the duration in seconds or hours and having the user do the “mental math” to convert it themselves this beast mode does that for the user to allow them to focus more on the story the data was telling.
Beast Mode
CONCAT( CASE WHEN `Ship Time` <= `Order Time` THEN '-' ELSE '' END, -- Days FLOOR ( ABS ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`) ) / 86400 ), 'd ', -- Hours, Minutes and Seconds SEC_TO_TIME ( ABS ( MOD ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`), 86400 ) ) ) )
Beast Mode Breakdown
CASE WHEN `Ship Time` <= `Order Time` THEN '-' ELSE '' END
If the ship time is before the order time precede the result with a negative. This allows us to simplify the logic calculating the difference and to have the negative displayed at the beginning of the number days instead of in the middle at the beginning of the hours.
UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`)
UNIX_TIMESTAMP returns the number of seconds (epoch) since January 1st 1970
Subtracting two UNIX_TIMESTAMP values calculates the difference between two timestamps in seconds
ABS ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`) ) / 86400
ABS will return the absolute value of the difference between the two times. This will force a negative difference to be positive. Again this allows us to simplify the logic and display the negative symbol one time instead of before the days and before the hours:minutes:seconds.
Dividing the number of seconds by 86400 (number of seconds in a day / 24*60*60) gets the number of days
FLOOR ( ABS ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`) ) / 86400 )
FLOOR drops anything after the decimal point returning whole days in the duration. We’ll be converting the partial days in the next step to hours, minutes and seconds.
SEC_TO_TIME ( ABS ( MOD ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`), 86400 ) ) )
MOD function will divide the duration in seconds by the number of seconds in a day (86400) and return the remainder. This will be the value of the partial day in seconds.
SEC_TO_TIME will take the remaining seconds and format it as HH:MM:SS
CONCAT(…)
CONCAT will add the different string values together to form a single value
Final Result:
Converting a duration time text field into a number
I have a field from NetSuite called duration, which is a measure of time in this format 8:30
This stands for 8 hours and 30 minutes of work time.
I need to convert it from a text to a number so I can create measure.
Thank you!
Jayme K.
Data never sleeps turns 11!
If you’re new to the Domo on Data-verse, this is our annual report that captures the world’s data usage by the minute.
If you're a data nerd, you'll want to read up on the latest article by Domo's Senior Director of Strategic Architecture, Jace McLean.
Re: Option to allow the "Filter Bar" be visible by default
It would be great if we could pin it like we have for the sidebar. We just noticed this today in our organization and I'm not loving the inconvenience of having to click on the icon every time I load a new page/dashboard.
Re: enabling embedded App Studio app to have export functionality
@art_in_sky sorry I don't know how to do that but I agree there shouldn't be a difference between app studio and embed.








