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