Issue converting string to number in beast mode
I've seen some others posts about this and have gotten this to work on other cards but I'm having an issue converting a string to a number on this card. I've tried `Field_name`*1 and I've tried CAST(`Field_Name` AS DECIMAL(10,2)) but I get back a 0 or null response in the newly created column. I've also tried a CASE statement to exclude null or blank fields. Is there any way to do this?
Original column: Credit_Final
New Column: Credit Final (or whatever)
Any help is greatly appreciated.
Best Answer
-
the column you want to convert to a numeric/decimal column contains the character '$' and doing this wont be possible unless you remove the character. Also, I have never used a cast function in a beast mode and i dont believe it exists.
To replace the '$' character you can use the replace function and then multiply it by 1, you can also add a condition for null.Eg: ifnull(REPLACE(`field_name`,'$',''),0) * 1
However, I would advise you to do this conversion in the dataflow or workbench when you are loading the dataset.
Let me know if you have any questions.
0
Answers
-
the column you want to convert to a numeric/decimal column contains the character '$' and doing this wont be possible unless you remove the character. Also, I have never used a cast function in a beast mode and i dont believe it exists.
To replace the '$' character you can use the replace function and then multiply it by 1, you can also add a condition for null.Eg: ifnull(REPLACE(`field_name`,'$',''),0) * 1
However, I would advise you to do this conversion in the dataflow or workbench when you are loading the dataset.
Let me know if you have any questions.
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
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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