Help with LEFT function in Beast Mode CASE Statement

I am having trouble with the LEFT function in a CASE statement. It works as expected outside the CASE statement.
When I use this beast mode:
LEFT(`Material`, 4)
I get the first 4 characters in the Material column.
When I use this Beast mode
(CASE when `Process`= 'Lathe' then
'Lathe'
/*LEFT(`Material`, 4)*/
end)
I get several items in the column with 'Lathe'
But when I use this beast mode
(CASE when `Process`= 'Lathe' then
/*'Lathe'*/
LEFT(`Material`, 4)
end)
I don't get anything in that column
I was careful to pick 'material' from the dataset fields in all cases.
Any ideas?
Best Answer
-
Is there always data in all 3 columns: Process, Lathe, Material? If you aren't seeing the left 4 characters of material when the process column equals the lathe column, I would doublecheck that the material column is populated when the process and lathe columns are the same.
To troubleshoot, I would use a table card with those 3 columns in the table and then create a beast mode that says:
CASE WHEN 'Process' = 'Lathe' THEN 'Y' ELSE 'N' END
I would then drag this beast mode into the filters and filter to Y. The table should then show you the values that you would be working with in your earlier beast mode and may shed some light as to what the issue is.
Another thing to try would be to apply the TRIM and LOWER functions to your evaluation of the process and lathe columns to ensure there isn't spacing or case sensitivity causing issues. You could also apply the TRIM function to the material column before applying the LEFT function.
Hope this helps.
**Check out my Domo Tips & Tricks Videos
**Make sure toany users posts that helped you.
**Please mark as accepted the ones who solved your issue.2
Answers
-
Is there always data in all 3 columns: Process, Lathe, Material? If you aren't seeing the left 4 characters of material when the process column equals the lathe column, I would doublecheck that the material column is populated when the process and lathe columns are the same.
To troubleshoot, I would use a table card with those 3 columns in the table and then create a beast mode that says:
CASE WHEN 'Process' = 'Lathe' THEN 'Y' ELSE 'N' END
I would then drag this beast mode into the filters and filter to Y. The table should then show you the values that you would be working with in your earlier beast mode and may shed some light as to what the issue is.
Another thing to try would be to apply the TRIM and LOWER functions to your evaluation of the process and lathe columns to ensure there isn't spacing or case sensitivity causing issues. You could also apply the TRIM function to the material column before applying the LEFT function.
Hope this helps.
**Check out my Domo Tips & Tricks Videos
**Make sure toany users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
Thanks so much, you nailed it! I was missing materials in the material column. I so appreciate the help. Once you said it, it was obvious what was happening.
0
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 305 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 106 SQL DataFlows
- 645 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 774 Beast Mode
- 74 App Studio
- 43 Variables
- 727 Automate
- 186 Apps
- 466 APIs & Domo Developer
- 61 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 403 Distribute
- 117 Domo Everywhere
- 277 Scheduled Reports
- 9 Software Integrations
- 136 Manage
- 133 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 112 Community Announcements
- 4.8K Archive