Cast and Convert

Can I use Cast and Convert in dataflows? Is there something special I need to do?
Best Answer
-
Steven, can you give an example of what you're trying to convert? Is it a string to a number, or something similar to that? Also, are you using a MySQL dataflow or something else?
If you field is a string, but really has a number in it (e.g. '997') you can convert it on the fly by using it in a mathematical expression. For example, if the field `Amount` is a string column, but really has numbers in it, you could use
`Amount` * 2
and the dataflow will convert the `Amount` to a number then do the multiplication. Going the other way is pretty easy too, actually. If you want a number to be a string instead, just concatinate it with something. If `Amount` is a numeric field,
CONCAT('$', `Amount`)
will put it into the string with a "$" in front of it. Alternatively, you can change it to a string by itself by concatenating it with an empty string (two single-quotes right next to each other), like this
CONCAT(`Amount`, '')
Does that help?
5
Answers
-
Steven, can you give an example of what you're trying to convert? Is it a string to a number, or something similar to that? Also, are you using a MySQL dataflow or something else?
If you field is a string, but really has a number in it (e.g. '997') you can convert it on the fly by using it in a mathematical expression. For example, if the field `Amount` is a string column, but really has numbers in it, you could use
`Amount` * 2
and the dataflow will convert the `Amount` to a number then do the multiplication. Going the other way is pretty easy too, actually. If you want a number to be a string instead, just concatinate it with something. If `Amount` is a numeric field,
CONCAT('$', `Amount`)
will put it into the string with a "$" in front of it. Alternatively, you can change it to a string by itself by concatenating it with an empty string (two single-quotes right next to each other), like this
CONCAT(`Amount`, '')
Does that help?
5 -
The multipying by 1 is a great work around. The trouble was that I had values that DOMO thought were categories, which made card building impossible.
2 -
Awesome info! Really helped me out a pinch! Thanks man!
0 -
Perfect!
0
Categories
- All Categories
- Product Ideas
- 2K Ideas Exchange
- Connect
- 1.3K Connectors
- 308 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 661 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 819 Beast Mode
- Visualize
- 2.6K Charting
- 85 App Studio
- 46 Variables
- Automate
- 193 Apps
- 483 APIs & Domo Developer
- 85 Workflows
- 23 Code Engine
- AI and Machine Learning
- 22 AI Chat
- 3 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 116 Domo Everywhere
- 282 Scheduled Reports
- 11 Software Integrations
- Manage
- 142 Governance & Security
- 9 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 5K Archive