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.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive