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.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 292 Workbench
- 4 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 95 SQL DataFlows
- 600 Datasets
- 2.1K Magic ETL
- 3.7K Visualize
- 2.4K Charting
- 685 Beast Mode
- 43 App Studio
- 38 Variables
- 655 Automate
- 170 Apps
- 438 APIs & Domo Developer
- 42 Workflows
- 5 DomoAI
- 32 Predict
- 12 Jupyter Workspaces
- 20 R & Python Tiles
- 384 Distribute
- 110 Domo Everywhere
- 268 Scheduled Reports
- 6 Software Integrations
- 111 Manage
- 108 Governance & Security
- 8 Domo University
- 25 Product Releases
- Community Forums
- 39 Getting Started
- 29 Community Member Introductions
- 98 Community Announcements
- Domo Community Gallery
- 4.8K Archive