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
- 10.5K All Categories
- 7 Connect
- 917 Connectors
- 250 Workbench
- 465 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 477 Datasets
- 193 Visualize
- 252 Beast Mode
- 2.1K Charting
- 11 Variables
- 17 Automate
- 354 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 246 Distribute
- 62 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 173 Product Ideas
- 1.2K Ideas Exchange
- 12 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive