Best Of
Re: If possible, how can I call a Stored Procedure or Function?
@ricsanders and @Jose_Rojas Domo does not really have the concept of stored procedures or functions available for execution in Magic dataflows.
You can create stored procedures in MySql dataflows but i strongly recommend you avoid them because MySQL (v5.6) is significantly more effort to optimize and maintain if you're trying to hand dataflow pipeline design to other users.
for @ricsanders, we typically recommend building your datasets with all the users in it, then just use a Filter Card to select the user you want to display information for in your dasbhoard. -- I can appreciate that xx million might feel like a lot of wasted disk space if you have to read the entire table, but typically for Domo, millions of rows in a card is still going to yield acceptable end user experience performance-wise.
@Jose_Rojas you may need to handle your scheduling external to Domo if you have a snowflake procedure that needs to finish successfully BEFORE you ingest data into Domo. You might look at using Python to automate testing "did my snowflake procedure finish? if yes trigger Domo dataset execution."
Totally different use case, but here's an example of how you might build the LOOP structure.
Re: Combining data into one pie chart
@louiswatson You can use the Add Constants tile in ETL. You'll add one tile per branch of your ETL and name the column the same for each one (Stage), and then for each constant, put the name of the stage that corresponds to the filters.
Additionally, depending on your comfort level with CASE WHEN statements and the complexity of your filters and other tiles, you could do this without having to create different branches using a formula tile with a long case when formula.
Re: Combining data into one pie chart
@louiswatson are your stages mutually exclusive? if so, I think your next step will be a group by tile for each stage (group by stage and then count panels?) and then an append which will stack your 5 categories together.
So i'd think your end dataset goal is:
which you'd then build your pie chart off... is this what you're aiming for?
mhouston
Re: Combining data into one pie chart
They are all in a status from Pipedrive called 'Lost', I'd like to show a breakdown of the sites in lost. This is where the additional filters/date ranges differ from each dataset.
All I need to do now is group the values into the filter groups below (tenure, instructed, no tenure, tenure no planning etc) and use the values for the pie chart. I wasn't sure how to group the data and combine together, the datasets are using 'No of panels' as the value. Hopefully this helps?
Turnover Calculation/ Beast Mode Help
I've got employee data coming in through our HRIS, and we've got a table that we link to, that provides our location hierarchy. I'd like to add a dynamic column to the merged data that gives me the current turnover for that location. The turnover formula we use is total number of terminations divided by the average number of employees at that location. (Ex. 6 employees have left the shop location, there is a current total of 12 employees at that shop, turnover is 50%).
If anyone has any suggestions for the best way to get this column into the data set, I would be very grateful. I think the turnover calculation needs to be placed on the location and not the employee to allow us to roll up the data through our hierarchy so we can show our market, region, and entire company's turnover.
Re: % Sold of Available Inventory (aka Sell-Through)
@ST_-Superman-_ I love the approach -- prevents me from needing to UNION my data, which doubles my rows. There must be some dimension in my actual full dataset that is not playing nicely with the solution because, at first pass, I get SUMs of Sell-Through and TotalStartingInventory -- 7,495% and 2,326,995 respectively, where the numbers should be around 6.9% and 1.5M.
I'll take another crack with fresh eyes and see if I can figure out what I'm doing wrong.
Either way - marking yours as an answer because it definitely works in the smaller dataset. Thanks very much for your response!!!
chapman
Re: % Sold of Available Inventory (aka Sell-Through)
Spent the better part of the day working on this and have a solution thanks to @MarkSnodgrass!! UNION was the answer here.
I was able to pass a date field into the inventory table and combine it with the new FIXED function to get the total inventory per store, per period with filters working as expected.
This returns the cumulative orderQty by day: SUM(SUM(`orderQty`)) OVER (ORDER BY `orderDate`)
This returns the total inventory available: SUM(SUM(`qtyAvail`) FIXED ())
And then I combine the two to get Sell-Through: SUM(SUM(`orderQty`)) OVER (ORDER BY `orderDate`) / SUM(SUM(`qtyAvail`) FIXED ())
@RobSomers had a novel idea but it broke when using filters. When calculating the sell-through on each row in ETL, I had to choose what the total inventory number was -- and it can vary depending on the current filters (store/region/etc.). I really wanted this idea to work so I didn't have to UNION and double my dataset but alas. Marking as an answer because it does work depending on your dataset/need to filter.
@jaeW_at_Onyx thank you for expanding on Mark's solution - the addition of activity_type is great for documentation. In this case, I found the FIXED function worked a little better than a window because it allows me to get the total for the entire [filtered] dataset without worrying about the dates I chose in the inventory data. I am finding reasons to use FIXED almost every day.
Thank you all very much for your awesome help!!!
chapman
Re: % Sold of Available Inventory (aka Sell-Through)
consider using window functions to get the desired result.
if you UNION your data (Consumption UNION to Inventory with a column activity_type = "consumption" or "inventory" so you can tell them apart) as @MarkSnodgrass recommended and structure your data such that you have Activity_Date and Activity_YearMonth,
you could construct your metric as a window function
sum(sum(consumption_amount)) over (partition by item, activity_yearMonth order by activity_date asc) -- this will give you the cumulative sum of your consumption for the month.
sum(sum(inventory)) over (partition by item, activity_yearMonth order by activity_date asc) will give you available inventory.
you can either choose to include activity_yearMonth in the partition clause or exclude depending on if you want the counter to reset every month.



