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
- 1.1K Product Ideas
- 1.1K Ideas Exchange
- 1.2K Connect
- 969 Connectors
- 256 Workbench
- Cloud Amplifier
- 1 Federated
- 2.4K Transform
- 76 SQL DataFlows
- 500 Datasets
- 1.8K Magic ETL
- 2.7K Visualize
- 2.2K Charting
- 369 Beast Mode
- 19 Variables
- 483 Automate
- 101 Apps
- 378 APIs & Domo Developer
- 6 Workflows
- 22 Predict
- 6 Jupyter Workspaces
- 16 R & Python Tiles
- 316 Distribute
- 64 Domo Everywhere
- 252 Scheduled Reports
- 59 Manage
- 59 Governance & Security
- 1 Product Release Questions
- 5K Community Forums
- 37 Getting Started
- 23 Community Member Introductions
- 63 Community Announcements
- 4.8K Archive