Best Of
Re: Paritoning beta. Where to start?
This video is from back in January. It definitely mentions the use cases I am interested in but I am still not sure exactly how to configure things. I'm still unclear on what to partition on especially when a dataset that are created with connectors without partitioning are used in the dataflow
Re: Conditional Formatting in Pivot Table
I agree, I have tables that I have each row represent a month and it progressively updates each month and I would like to be able to highlight the row of the current month, but its not a total or a subtotal row.
DP22 - Using Beast Mode to Build Data Storytelling - Adding Business Days
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
When evaluating different carriers for performance we needed a simplistic calculation to quickly determine how often they were delivering packages on time. The delivery days promised by the carriers are in business days however the days an order was shipped and when it was delivered are actual calendar days. This beast mode allows us to add a specific number of business days to a date to compare to when a delivery was made. This calculation assumes a work week of Monday through Friday and doesn’t consider the days in which the business was closed (for example holidays).
Beast Mode
`Ship Time` + INTERVAL ( FLOOR(`Estimated Delivery Days`/5) * 7 + CASE WHEN MOD(`Estimated Delivery Days`,5) + DAYOFWEEK(`Ship Time`) >= 7 THEN 2 - FLOOR(DAYOFWEEK(`Ship Time`)/7) ELSE 0 END + MOD(`Estimated Delivery Days`,5) ) DAY
Beast Mode Breakdown
FLOOR(`Estimated Delivery Days`/5) * 7
`Estimated Delivery Days`/5 converts the business days into calendar weeks as there are 5 business days per week (Monday - Friday).
FLOOR returns the whole number rounded down to get the number of full weeks. Partial weeks will be added later.
Multiply by 7 to convert to calendar days
DAYOFWEEK(`Ship Time`)
DAYOFWEEK takes a date and returns a value for the number of the day of the week (1 – Sunday … 7 – Saturday)
MOD(`Estimated Delivery Days`,5)
This is the number of business days left in the partial business week
CASE WHEN MOD(`Estimated Delivery Days`,5) + DAYOFWEEK(`Ship Time`) >= 7 THEN
Putting these both into In simpler terms - Does the partial week cause us to go into the weekend (beyond Saturday / day 7)?
FLOOR(DAYOFWEEK(`Ship Time`)/7)
Returns 0 for Sunday – Friday, 1 for Saturday. DAYOFWEEK will return 1-6 Sunday-Friday and 7 for Saturday. Dividing this by 7 returns a number < 1 for Sunday-Friday and 1 for Saturday. FLOOR converts any decimal less than 1 to be 0 by dropping the decimals. This is an alternative way to do
CASE WHEN DAYOFWEEK(`Ship Time`) = 7 THEN 1 ELSE 0 END
2 - FLOOR(DAYOFWEEK(`Ship Time`)/7)
If the start date was Saturday only add one day to get throught the weekend instead of the standard 2 days
MOD(`Estimated Delivery Days`,5)
Use the MOD function to divide the estimated business days we’re adding and get the remaining to add to the calendar date.
Final Result
Bonus - On Time Deliveries
We can take this one step further and use another CASE statement to bucket our deliveries into either On-Time or Late
CASE WHEN `Delivery Time` <= (`Ship Time` + INTERVAL ( FLOOR(`Estimated Delivery Days`/5) * 7 + CASE WHEN MOD(`Estimated Delivery Days`,5) + DAYOFWEEK(`Ship Time`) >= 7 THEN 2 - FLOOR(DAYOFWEEK(`Ship Time`)/7) ELSE 0 END + MOD(`Estimated Delivery Days`,5) ) DAY) THEN 'On-Time' ELSE 'Late' END
Re: How to add gross profit row into profit and loss pivot table
@RayRay_H yes that's definitely a limitation and I think that's partially why they created the domo finance app (you can search for it in the appstore). Also, wanted to update you that we did follow the suggestions here and created the P&L calcs through dataflows and weren't too bad at all to do. But now it makes for a much cleaner looking P&L… basically there are no aggregations or calcs anymore at the card level… we just display the metrics and calcs together.
Re: how to define full quarters
Love @colemenwilson approach! I might be overthinking it but there is a slight change I would make to Step 4, since currently the formula would return Full Quarter for the following scenarios for example:
- something that only has entries from 1/1 to 1/31, since it is Q = 1 starting on a 1st and ending on a 31st.
- something with entries from 6/1 to 6/30, since it is Q = 2 and starts on a 1st ending on a 30th.
So you might want to check also the Month of the Minimum Date and Minimum Date to ensure is taking a full quarter.
Just keep in mind that as he stated, you need to have an entry for each campaign day even when there are no engagements, so you might need to create additional entries first to ensure this. Also Quarter returns a single 1-4 number, so if you have campaigns that might span for more than a year, you might want to do something like for your Distinct Count:
(QUARTER(`Date`)-1)+4*YEAR(`Date`)
Which returns a unique number that represents each quarter.
@cthtcc, something you might want to think about, since the final goal is to show average quarterly engagements, is how should your report work when a campaign has not been active for at least 1 full quarter? Lets say it launched on 1/20/2023 and we're on 6/29/2023, so it has not been active for a single full quarter, although it has been active for more than 5 months. In your current definition that would be 0 full quarters which will error out when trying to do the division. You could consider that each quarter has on average 92 days, so you can prorate.
Re: how to define full quarters
Okay is the total engagements field populated every day during the duration of the campaign? If so, this is how I did it:
ETL overview:
Step 1:
Add Quarter and Year if not already in your data
Step 2:
Use 2 group by tiles to get the minimum date and maximum date for each campaign within each quarter. Minimum is shown below. Maximum is the same except you choose 'Maximum' as the aggregation type instead of minimum.
Step 3:
Join the data so that for each row you have the minimum and maximum dates
Step 4:
Create a field using the formula tile:
CASE
-- Q1
WHEN Quarter = 1 AND DAY(Minimum Date) = 1 AND DAY(Maximum Date) = 31 THEN 'Full Quarter'
-- Q2
WHEN Quarter = 2 AND DAY(Minimum Date) = 1 AND DAY(Maximum Date) = 30 THEN 'Full Quarter'
-- Q3
WHEN Quarter = 3 AND DAY(Minimum Date) = 1 AND DAY(Maximum Date) = 30 THEN 'Full Quarter'
-- Q4
WHEN Quarter = 4 AND DAY(Minimum Date) = 1 AND DAY(Maximum Date) = 31 THEN 'Full Quarter'
ELSE 'Partial Quarter' END
Step 5:
Join this data back to your base data
Step 6:
Filter out 'Partial Quarter' in your card
This is what the data would look like for reference:
Domo Cards using Variables - Are they bugged right now?
I have a few cards that use Variables in them. Yesterday it seemed that they weren't properly loading filters on the side of the card. This morning they have fully broken. I have tried re-building two of the cards from scratch but whenever a Variable is used the card and/or filters will no longer render properly.
Relatedly, what would the best way to see if this an issue across the entire platform?












