Best Of
Domo Ideas Exchange - Beast Modes - First / Last Days of the Month / Week
Problem:
How Do I calculate the start or end date of the week or month?
Solution:
Last Day of the Month:
This is fairly simple as we can use utilize the LAST_DAY function which will return the last day of the month for the provided date.
LAST_DAY(`dt`)
First Day of the Month:
For this we can do some simple math to subtract a specific number of days. We need to get back to day one. The DAYOFMONTH function will return the day number of the supplied date. We just need to subtract one less from the date's day number
-- Author: -- Created: -- Last Modified: -- Description: Subtract the number of days of the date (except one) to get the first of the month -- 24-(24-1) => day 24 - 23 days = day 1 DATE_SUB(`dt`, INTERVAL (DAYOFMONTH(`dt`) - 1) DAY)
Last Day of the Week:
Similar to the first day of the month we can utilize math to add a specific number of days to get to Saturday. There is a function called DAYOFWEEK which will return a number between 1 (Sunday) and 7 (Saturday). We simply need to calculate the difference from the given date to Saturday and add that number of days.
-- Author: -- Created: -- Last Modified: -- Description: Get the last day of the week. -- This is done by getting the day of the week (1-7) and adding the number -- of days needed to equal 7 (Saturday) DATE_ADD(`dt`, INTERVAL (7- DAYOFWEEK(`dt`)) DAY)
First Day of the Week:
For the First day of the week we do the opposite of the Last Day of the Week and subtract days until we get to day 1 of the week.
-- Author: -- Created: -- Last Modified: -- Description: Get the first day of the week -- This is done by subtracting the day number (1-7) from the given date. -- 5 (Thursday) - (5-1) days => 5 - 4 = 1 (Sunday) DATE_SUB(`dt`, INTERVAL (DAYOFWEEK(`dt`) - 1) DAY)
Re: YOY Running Total Line card
Is there a row in your dataset for April? If not, I think you need to add a row for April where the quantity is zero.
mhouston
Re: Deduplicating a table based on the content of certain columns
The easiest way to do this is to use the Group By tile in Magic ETL. Add all your columns in the select except for the last_updated column. Add that one to the aggregated column list and choose Max. This will give you the most recent date for each.
Re: Help with Formula/ Beast mode to concat values based on unique key
I think you just have a syntax error. You should not have "as reason" in your case statement. The syntax for case in Domo is:
CASE
WHEN .... THEN
ELSE
END
Otherwise, as long as your column names are valid, the formula should work (although you may want to add a space before 'reason' so that you have a space in the final value).
mhouston
Re: Domo CLI - Return Limit for List-Dataflow Command?
It appears to be a bug. I'm seeing the same thing in my case as well. I'd log a ticket with Domo Support.
DOMO PP plugin
I cannot figure out why my PowerPoint is not updating when using the Refresh cards using the domo plug in. I seems to work then stop working. Any reason it would cause a powerpoint to not update from the updated cards? It seems like a simple process? Thank you, Jill Bowers
Re: How to add a Background image to the dashboard
If you're wanting to add an image as a background to the page you can do that but editing the page, selecting the options menu in the upper right, select change background, change Color fill to Image fill and then select the image you wish to use as your page background.
Re: hide and show card on the dashboard based on the filter selection
Domo doesn’t provide an option to toggle card visibility currently. I’d recommend logging and idea in the idea exchange for this as I’m sure others would find it useful.
Re: Drill PDP
You can’t dynamically disable drill paths but you could utilize a different dataset on your drill path card which had PDP enabled to only the groups you wish to have access.
Re: Replace an excel file uploaded using File Upload Legacy connector
If you go to the dataset in the data center and click on it, you can then go to the settings tab and re-upload a file.

