Best Of
Re: Replace text and value mapper failing
I would suggest moving away from the replace text and value mapper tiles and use the formula tile in your ETL. It is much more flexible and you can do all your work in a single tile.
You can do something like this in the formula tile.
CAST( CASE WHEN `field` = '#DIV/O' THEN 0 WHEN `field` = '--' THEN 0 ELSE `field` END as INTEGER)
You can add additional WHEN statements for other variations that your data might have. You might also want to use the TRIM function around your field in case there are spaces.
Another option is this where it tests to see if it can convert it to an integer and using the number if it can, otherwise it will make it a zero.
CAST( CASE WHEN TRY_CAST(`field` as INTEGER) > 0 THEN `field` ELSE 0 END as INTEGER)
You could use NULL instead of 0 in your ELSE statement if that is more appropriate.
Hope this helps.
Re: Requests Older than 6 Days
Hi @Fadem
You need to change the order if using "greater than or equal to" 6
like this
SUM(case when DATEDIFF(CURRENT_DATE(),`Effective Time`) >=6 then 1 else 0 end)
DP22 - Using Beast Mode to Build Data Storytelling - Links and Images
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 to enhance the visualization experience and allow users to see which specific item we’re referencing with an image rather than just a specific ID code. Another think we wanted to do was to allow users to click on the image or hyperlink to go to the website to get more information on the product rather than having to look it up themselves. We utilized a Mega Table for this but the beast mode will also work in an HTML table if desired.
Beast Mode
CONCAT( '<A HREF="https://my.url.com/store/detail/', `Product ID`, '" TARGET="_blank">', '<IMG SRC="https://my.url.com/images/items/', `Product ID`, '-small.jpg"/>', '</A>’)
Beast Mode Breakdown
Hyperlinks
CONCAT('<A HREF="https://my.url.com/store/detail/', `Product ID`, '" TARGET="_blank">@</A>’)
Generates HTML code to create hyperlink for users to click on by dynamically creating the URL with the correct product ID. For example: <A HREF="https://my.url.com/store/detail/SM58" TARGET="_blank">@</A>
TARGET="_blank" causes the link to open in a new tab instead of replacing the existing window. This is important because if it’s opened in a new window and a user clicks back to get back to the card they will lose all of their filtering. Opening a new tab allows the card to still exist with the filtering in place giving a much better user experience.
Whatever is in between the <A> and </A> tags will be highlighted for the user to click on and go to the URL defined in the HREF. In this example @ is the text that will be highlighted for a user to click.
Can only use mailto, http and https protocols in hyperlinks.
Images
CONCAT('<IMG SRC="https://my.url.com/images/items/', `Product ID`, '-small.jpg"/>’)
•
Dynamically generate the URL of the image using the product ID For example: https://my.url.com/images/items/SM58-small.jpg
CONCAT wraps the dynamic URL in HTML IMG tag to tell the browser to display an image
Images & Hyperlinks
CONCAT( '<A HREF="https://my.url.com/store/detail/', `Product ID`, '" TARGET="_blank">', '<IMG SRC="https://my.url.com/images/items/', `Product ID`, '-small.jpg"/>', '</A>’)
Combines the logic from the Link beast mode with the Image beast mode to allow for users to click on the image to open the link.
We’ve replaced the @ in the Link beast mode
Final Result
Clinking the image takes you to the webpage defined in the A tag's HREF URL.
DP22 - Using Beast Mode to Build Data Storytelling - Sales Pacing Graph
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 needed a way to display and estimate in real time how well our sales were pacing for the current month to allow stakeholders to quickly make informed decisions. To do this we created a sales pacing graph to determine the current month’s running total and where sales are projected to be at the end of the month.
Beast Modes:
Running Total
SUM(SUM(`Daily Sales`)) OVER (PARTITION BY LAST_DAY(`Order Date`) ORDER BY `Order Date`)
Run Rate:
SUM(SUM(`Daily Sales`)) OVER (PARTITION BY LAST_DAY(`Order Date`) ORDER BY `Order Date`) / DAYOFMONTH(`Order Date`) * DAYOFMONTH(LAST_DAY(`Order Date`))
Beast Mode Breakdown:
Running Total
SUM(SUM(`Daily Sales`)) OVER (PARTITION BY LAST_DAY(`Order Date`) ORDER BY `Order Date`)
OVER denotes a window function. Window functions in beast modes are a feature switch. Talk with your CSM to get this enabled.
Window functions allow us to calculate an aggregation across the partition or entire dataset and return that value as a single value within each row.
PARTITION BY LAST_DAY(`Order Date`)
PARTITION BY Defines the bucket we want to aggregate over
Can exclude to aggregate over the entire dataset.
LAST_DAY returns the last day in a month. This is a way to group by each month. It’s an alternative to (PARTITION BY YEAR(`Order Date`), MONTH(`Order Date`))
ORDER BY `Order Date`
Defines the order in which to calculate the running total.
If excluded it will be the grand total within your partition.
SUM(SUM(`Daily Sales`))
Normal SQL is a single aggregation however Domo can potentially do aggregation twice. First when the data is initially loaded into the card. Another time when you have selected aggregation on another field on the card.
Because a window function returns a single value for each row we need to tell Domo how to aggregate the data (again) when the card does aggregation.
Run Rate
SUM(SUM(`Daily Sales`)) OVER (PARTITION BY LAST_DAY(`Order Date`) ORDER BY `Order Date`) / DAYOFMONTH(`Order Date`) * DAYOFMONTH(LAST_DAY(`Order Date`))
SUM(SUM(`Daily Sales`)) OVER (PARTITION BY LAST_DAY(`Order Date`) ORDER BY `Order Date`)
This is the Running Total beast mode from above. We want to get the month's total at the date given.
/ DAYOFMONTH(`Order Date`)
Divide by the day number of the order date (DAYOFMONTH) to get the average amount per day. In other words the number of days that have elapsed in the current month as of the Order Date
* DAYOFMONTH(LAST_DAY(`Order Date`))
LAST_DAY returns the last date in the given month. DAYOFMONTH will tell us the day number of the last day of that month. In other words, the number of days in the given month. Multiplying our average we just calculated will give us an estimate for the end of the month as of the Order Date value.
Final Result:
Re: Assigning blank value as Zero
COALESCE(`rate`, 0)
Coalesce also works. It returns the first non-null value supplied. This is assuming your data is actually NULL and not an empty string. If it is you can force it to be null:
COALESCE(NULLIF(TRIM(`rate`), ''), 0)
TRIM to strip whitespaces at the beginning and end of the string for good measure.
Also to address your beast mode IFNULL will return a value but it's not evaluating to TRUE for FALSE as the case statement expects. This is why you're getting an error.
Re: Scheduled Reports
Unfortunately, when a table is the scheduled report, Domo is essentially taking a picture of the table card and including it in the body. It is a fixed width and can't be adjusted. It would be a nice enhancement if the full table card was included, though.
Re: Change Update Method Using Pydomo
Definitely reach out to Support [support.domo.com] then to have them look at it as well (and escalate to Dev if need be).
amehdad
Removing sort symbol from graph
Is there any way to remove the sort symbol from view? It can be obstructive when looking at the axis numbers.
I can't find anything in 'Chart Properties' to disable it.
amehdad
Re: Do Beast Modes show up on Views?
Are the beastmode calculations that you are looking for saved to the dataset, or just the card?
If they are saved to the dataset, then you should see them in the dataset view as well. You may have to select the "+ Add Column" button first
Re: Report to show how many cards use the same specific dimension
In the Domo Governance Dataset Connector there's a Card Fields and Beast Modes report which should list all the fields used on a card for you. You can then take that data, group by the dataset and field and count the distinct number of card IDs to see how many cards are using the field.




