Best Of
Re: How do I take a portion of a column value and push it to a new column?
CASE WHEN REGEXP_LIKE(`field`, '^(A\d+).*$') THEN REGEXP_REPLACE(`field`, '^(A\d+).*$', '$1') ELSE 'unassigned' END
You can use a formula tile and a regular expression to pull out the values which start with A followed by some numbers.
^ - Start of the line
() - Match group to store the results found - in this case the first match group which is stored in the variable $1
A - the literal letter A
\d+ - One or more digits
.* 0 or more of anything
$ - The end of the string
Re: How do I take a portion of a column value and push it to a new column?
I would recommend using the split column tile in magic ETL.
It would look something like this:
Re: How to show YTD data in Tabular format?
@SayyedHussain If you want to only include months to date you can add a beast mode filter like the one below:
case when MONTH(`Date`) <= MONTH(CURRENT_DATE()) then 'Include' else 'Exclude' end
Re: How to show YTD data in Tabular format?
@MichelleH It's working as expected now. Thank you for your help!! 😀
Re: Can someone help me calculate employee turnover in Domo?
This required me to use a dataflow. I am more comfortable using MySQL, so that is how I built this data set. If you would prefer me to walk through the ETL side of things, please let me know.
Step 1:
You need to add a calendar data set. This dataset needs to list every day that you would be interested in being able to analyze. Domo offers their own calendar data set which you can obtain by:
This data set only goes back to Jan 1, 2010. If you need to go further back, you will need to obtain another calendar data set.
Once you have your calendar data, we can move on to adding a MySQL data flow.
Step 2:
Transform 1:
SELECT
`dt` as `Date`
FROM `calendar`
I saved that as "dates_table"
Transform 2:
SELECT
k.`ID`,
k.Name,
k.Title,
k.Department,
k.Location,
k.Team,
k.Manager,
k.`Hire Date`,
k.`Termination Date`,
k.`Termination Type`,
k.`Terminations`,
k.`Current Employees`,
k.`Status`,
d.`Date`,
case
when d.`Date` >= k.`Hire Date` and `Termination Date` is null then 'Active'
WHEN d.`Date` >=k.`Hire Date` and d.`Date` < k.`Termination Date` then 'Active'
WHEN d.`Date` = k.`Termination Date` then 'Termination'
END as `Status on Date`
FROM `dojo_kstevens1` k
LEFT JOIN `dates_table` d
ON ((k.`Hire Date`<= d.`Date` AND k.`Termination Date` is null)
OR (k.`Hire Date`<= d.`Date` and k.`Termination Date` >= d.`Date`))
AND d.`Date` <= CURDATE()
I forgot to name this table, so it is called "transform_data_1"
for the output table:
SELECT * FROM transform_data_1
This will let you create the chart you are looking for with a few beastmodes.
Beastmode #1:
Active ID Count
COUNT(DISTINCT case when `Status on Date`='Active' then `ID` end)
Turnover Rate
COUNT(DISTINCT
case
when `Status on Date`='Termination' then `ID` end)
/
COUNT(DISTINCT
case
when `Status on Date`='Active' then `ID` end)
Here is my chart, you can dynamically pick any two dates by selecting the "between" option under the date drop down and you will get a line chart showing the number of employees by day (or week/month/etc. if you would like) The summary number will display the Turnover rate for the period selected. You also have the option to filter on location or department.
Hope that helps.
FYI, your data set will get pretty large. You are essentially creating a row of data for every day of employment, for every employee. This is required if you need to be able to see the turnover rate between any two dates. You could reduce the data set if you only need to be able to select any two weeks, or any two months.
Re: Wildcard for numbers not characters in Beast Mode or Magic ETL?
You'll need to start specific and then work your way down the list to be more generic with a case statement that way the more specific (BC or BW in your case) will be evaluated first.
CASE WHEN `Col_ori` LIKE 'BC%' THEN 'H' WHEN `Col_ori` LIKE 'BW%' THEN 'H' WHEN `Col_ori` LIKE 'B%' THEN 'B' END
Re: How to edit DATEDIFF to calculate beyond calendar year
So you're not using the actual date controls from Domo but a filter card instead, that is why the option to hide it won't work. What worries me is that you say that applying those same filters while editing the card does show results, that sounds like a really weird behavior and something for which you might need to reach out to support about, as that inconsistency in behavior shouldn't be happening.
- The "Controls" you have at the top of the page, are those variables or filter cards?
- If you apply only one of the two filters, say only the department, does the card work and shows you the right number?
- Have you tried adding the Year and Department fields as quick filters to the card and filtering the card with those instead?
If that Year field is predicated from the Incident table, and as you mentioned a department has no incidents in the year, getting the no Data In Range would make sense.
If they are Filter Cards, you might be able to get around by updating the dashboard and configuring the interaction on the Year card not to affect all the cards but the one were you show time since last incident, if it's a variable, then you'll need to see how the setting of that variable is being applied on your beastmodes on that card. Just an idea that might work.







