Case statement with two conditions
Hey!
I have a case statement below for inventory to create a pie graph.
Case
WHEN `AVAILABLE_COUNT` <= 20 THEN 'Out of Stock'
WHEN `AVAILABLE_COUNT` >= 40 THEN 'Sufficient Stock'
Else 'Low levels'
End
The only problem is that I have 2 warehouses I included as filters. However, when the data populates it separates the two locations as different entity and counts it separately.
If warehouse A has inventory, but warehouse B has no inventory, then it counts for two status.
Even if both warehouses have inventory, it still counts as two status because of location.
I want to have the total inventory counted as one status in both warehouses.
Sorry, if this is confusing. Let me know if you need any clarifications.
What should include in this beast mode calcuation?
Thanks!
Comments
-
Can you show a sample of your data/scenario?
Domo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
-
Anyone?
0 -
A way to go around the issue, but nto solve it as such, would be to combine the two warehouses using ETL then either create a separate DataSet or append it to the original and calling it Warehouse A+B in the Warehosue column.
Not as clean as the ideal but would work in principle.
0 -
Could you show how I would do it in ETL. I am pretty new to this.
Thanks!
0 -
I would suggest starting with the tutorials (Dataflows and Group by Function) then but I will give you info on the function you need to use.
The function is Group By
1 Coiumn that identifies the grouping is Item_ID
2 Name fo the new aggregated column can be Available Stock
3 Column to aggegate the fill the new column is Available_Count
4 How to aggegate column is Sum
This will generate a table with to columns
Item_ID, each item will only come up once, 149 lines in total
Available Stock, will have the combined count for each time.
After that you can use the new table as a data set or combine it with the original.
As I said it is not as clean as ideal but it will get you there. Ideally this would be done in beastmode but I cant think of a way to do it.
0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 293 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 96 SQL DataFlows
- 607 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 705 Beast Mode
- 49 App Studio
- 39 Variables
- 667 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 44 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 115 Manage
- 112 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive