Stock Open Opportunities by Active Account Executives in a period
Hi all!,
I need some help here. I have a dataset of active employees in a specific date or period builded with a snapshot dataset day by day.
I.e:
By the other hand, I have a dataset of opportunities, with "Date Created" and "Closed Date".
If an opportunity has a "Date Created" less than or equal to "active period" and Closed Date is empty or greater than active period, it was or it is an open opportunity.
I need to find a way to get the number of open opportunity in a date range, not just in a specific date.
Here an example of the opportunities dataset:
Here is what I expect:
I'll appreciate any help! Thank you all!
Guillermo Espindola
Best Answers
-
Hi @gespindola
I'd recommend you restructure your data such that you have one record for each day and opportunity.
You can do this by using the Domo date dimension table (Connector -> Domo Dimensions - Select calendar) and a mysql DataFlow (Magic doesn't allow between joins yet)
A pseudo example would look like
select `dt`, `opportunity` from dates d -- This is your domo date dimension table join opportunities o on d.`dt`>=o.`start_date` and d.`dt`<=o.`end_date`
This will then list all of the dates an opportunity is active for. You can then take this dataset and join it to your employee table based on their activity date to get the employees active on a specific date for a given opportunity.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
@gespindola , @GrantSmith 's idea is solid. only thing to be sure of is that there actually are start and end dates. if one column isn't populated it could cause a row to drop. consider adding a default start or end date if null.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1
Answers
-
Hello - can you provide any additional information on this? Like, for example, what was the purpose of describing the first table? I'm having trouble understanding how it's used in the final result. Also, how are the periods of interest in your expected dataset stored? and why are they sometimes ranges of dates and other times just single dates?
0 -
Hi Giacomo, Thanks for your response.
The reason I described the first table was because I need to see the Active Employees in a specific period.
For example:
- all active employees between Jan 1, 2021 and Jan 3, 2021 = 2 (A and B)
- all active employees on Jan 2, 2021 = 2 (A and B)
Then I have opportunities, so if I select "Between" Jan 1, 2021 and Jan 4, 2021 in the card, it should be:
A - All Active Employees between Jan 1, 2021 and Jan 4, 2021 (total = 2)
B - All Open Opportunities between Jan 1, 2021 and Jan 4, 2021. But an opportunity could be closed at Jan 2, so the open opportunities should be only those with Date Created less or equal than Jan 1 and Closed greater than Date Jan 4.
Each bar should show me B / A
I hope i explained myself well. Attached you can find and example of what I need (the data is the card is just a test)
Thank you in advance
0 -
Hi @gespindola
I'd recommend you restructure your data such that you have one record for each day and opportunity.
You can do this by using the Domo date dimension table (Connector -> Domo Dimensions - Select calendar) and a mysql DataFlow (Magic doesn't allow between joins yet)
A pseudo example would look like
select `dt`, `opportunity` from dates d -- This is your domo date dimension table join opportunities o on d.`dt`>=o.`start_date` and d.`dt`<=o.`end_date`
This will then list all of the dates an opportunity is active for. You can then take this dataset and join it to your employee table based on their activity date to get the employees active on a specific date for a given opportunity.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
@gespindola , @GrantSmith 's idea is solid. only thing to be sure of is that there actually are start and end dates. if one column isn't populated it could cause a row to drop. consider adding a default start or end date if null.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Thank you for your help guys! It worked :) @jaeW_at_Onyx , @GrantSmith
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive