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.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