Best Of
Re: Difference in Business Hours
I think I have something for you to get your started.
/* check to see if the start hour is too late */ (CASE WHEN HOUR(`startdate`) >= 17 THEN ((UNIX_TIMESTAMP(`enddate`) - UNIX_TIMESTAMP( /*move it to the next day and start at 9 */ ADDTIME(ADDDATE(DATE(`startdate`), interval 1 day),9*60*60))) / 3600) ELSE /* subtract and then divide by 3600 to get the hours */ ((UNIX_TIMESTAMP(`enddate`) - UNIX_TIMESTAMP(`startdate`)) / 3600) /* if there is a difference in days, subtract 16 hours per day */ - (DATEDIFF(`enddate`,`startdate`)*16) END )
You will need to add some additional case statements to deal with weekends by using the WHEN WEEKDAY(startdate) IN (1,7) which is Sunday and Saturday as I wasn't sure how you want to handle those. Hopefully the above makes sense. For a deeper dive into unix_timestamp, you might want to look at this post.
https://dojo.domo.com/discussion/52682/domo-ideas-conference-beast-modes-time-difference-formatting
With my testing this is what the above beast mode produces.
Hope this helps.
Re: Is there a way to create Running Total using Beast Mode?
Hi @lvtrujillot
You can utilize window functions in beast modes to accomplish this. You'll need to talk with your CSM to get it turned on. I've done a previous write up of window functions and running totals before. You can read up on it here: https://dojo.domo.com/discussion/52681/domo-ideas-conference-beast-modes-running-totals#latest
Re: Share DataFlow (all input datasets)
Yes! It would also be great to see who already has access to a dataflow, similar to the dataset "Overview" tab.
Re: Is there a way to suppress sections (collections) in a page/dashboard?
Thanks @MarkSnodgrass , even though I don't like your answer :), I appreciate the quick response.
Idea submitted!!
Re: Where can I find the logic for custom built dimensions?
@Joe_M, if you aren't the owner of the dataset, you should also talk to the person that is managing that platform where these 'Segments' fields are coming from. They may have a taxonomy doc that will have each field defined.
amehdad
Re: How to make card of Monthly Total Sales & Price Per Unit and Summary Table With Corrected Color
Hi @LMS,
Here are some links to help:
amehdad
Re: Magic ETL Nested Case Statement
Thanks @MarkSnodgrass -- in the end, it was, as you had suggested a spelling error (which was not in my formula but was being outputted from the CRM automatically). Thank you!!
Re: Handle NULL in Magic
@TheLookout That's awesome! Thank you, this will save me a bunch of time.
Re: How to exclude BLANK values in histogram custom bins?
Hi @user000253
Are your values blank meaning an empty string '' or are they actually NULL meaning no data?
To handle both cases you could add an additional clause to your case statement with a COALESCE function:
CASE WHEN TRIM(COALESCE(`Flow Velocity (ft/s)`, '')) = '' THEN 'BLANK' WHEN CEILING(`Flow Velocity (ft/s)`)<= 10 THEN '0-10' WHEN CEILING(`Flow Velocity (ft/s)`)<= 50 THEN '10-50' WHEN CEILING(`Flow Velocity (ft/s)`)<= 100 THEN '50-100' WHEN CEILING(`Flow Velocity (ft/s)`)<= 150 THEN '100-150' ELSE '150+' END
COALESCE says to return the first non-null value it finds. So in this case if it's an empty string ('') it will return that value and compare it to an empty string, if it's null it will use the empty string to compare against instead of null. There's an extra TRIM in there just in case we have a value of all spaces to remove spaces from the beginning and end of our string (it would make a value of ' ' = '')
And then just filter out the BLANK value in your card.



