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.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
- 58 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
- 395 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 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