Cast and Convert
![Steven](https://us.v-cdn.net/6032830/uploads/defaultavatar/nZ5X977MOM3Z6.jpg)
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
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 303 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 104 SQL DataFlows
- 640 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 769 Beast Mode
- 72 App Studio
- 43 Variables
- 718 Automate
- 185 Apps
- 462 APIs & Domo Developer
- 57 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 402 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 9 Software Integrations
- 135 Manage
- 132 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive