How do I select specific rows in a data set based on a single variable date filter?
We have products that move through different status. As they move through these status a new row is generated in the data set (see example below) with the product name, the new status, the date the status started and end status date (set to 1/1/2050). The end date of the previous status is also updated. As a user, I want to enter a date and find out what status each product was in. The logic to calculate the correct status would be where selected filter date >= MAX(status started) and filter date < = MIN(end status date). For example using the -date below and filter date of 11/30/2023 would return
Boots - available
Sandals - available
Sneakers - out of stock
Pumps - discontinued
How would this be accomplished using DOMO?
Thank you
Product | Status | Status Start | Status End |
---|---|---|---|
Boots | Discontinued | 12/4/2023 | 1/1/2050 |
Boots | Available | 11/1/2023 | 12/3/2023 |
Boots | Out of Stock | 10/15/2023 | 10/31/2023 |
Boots | Available | 10/1/2023 | 10/14/2023 |
Boots | Pending | 7/12/2023 | 9/30/2023 |
Sandals | Available | 11/22/2023 | 1/1/2050 |
Sandals | Out of Stock | 9/12/2023 | 11/21/2023 |
Sandals | Available | 4/1/2023 | 9/11/2023 |
Sneakers | Out of Stock | 11/12/2023 | 1/1/2050 |
Sneakers | Pending | 11/1/2023 | 11/11/2023 |
Pumps | Available | 12/4/2023 | 1/1/2050 |
Pumps | Out of Stock | 11/1/2023 | 12/3/2023 |
Pumps | Available | 10/15/2023 | 10/31/2023 |
Pumps | Out of Stock | 10/1/2023 | 10/14/2023 |
Pumps | Available | 7/12/2023 | 9/30/2023 |
Best Answers
-
Using Variables!
First, create this variable:Second, create this beastmode:
CASE WHEN
Date Variable
>= MAX(Status Start
) andDate Variable
< = MIN(Status End
) THEN 'In' ELSE 'Out' ENDThird, apply the beastmode from step 2 as a filter on the card and select In = 'In' Or Not In = 'Out'
Fourth, apply different dates in the variable and watch the magic happen!
I tested using your exact data and got the expected results :)If I solved your problem, please select "yes" above
0 -
Not that I am aware of. I would recommend submitting that as an idea in the
Happy I could help!If I solved your problem, please select "yes" above
0
Answers
-
Using Variables!
First, create this variable:Second, create this beastmode:
CASE WHEN
Date Variable
>= MAX(Status Start
) andDate Variable
< = MIN(Status End
) THEN 'In' ELSE 'Out' ENDThird, apply the beastmode from step 2 as a filter on the card and select In = 'In' Or Not In = 'Out'
Fourth, apply different dates in the variable and watch the magic happen!
I tested using your exact data and got the expected results :)If I solved your problem, please select "yes" above
0 -
Thank you that does work I appreciate the help. A follow up question is it possible to set the default value to be the current date?
0 -
Not that I am aware of. I would recommend submitting that as an idea in the
Happy I could help!If I solved your problem, please select "yes" above
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
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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