DomoR Datatype Conversions
I'm using DomoR to fetch a dataset and a column that should be text is being read in as col_double(). Many values are only digits, but other values contain characters so must be read as a text field. Is there a way I can control for the incoming datatype so I don't lose those character fields? An example of the error message is below.
I'm thinking of ordering the incoming Domo dataset to put character values first...but wanted to ask this question while I work on that.
Thanks!
Warning: 25704 parsing failures.
row col expected actual file
3316 DonorID a double DNM002141 <raw vector>
10350 DonorID a double DNM026515 <raw vector>
13129 DonorID a double DNM004163 <raw vector>
13130 DonorID a double DNM004162 <raw vector>
19087 DonorID no trailing characters AB5KLCAA3 <raw vector>
Best Answer
-
Thank you @jaeW_at_Onyx . That is what I did to solve this situation yesterday:
- Create a new column of a simple text field prefix (TF-)
- Concatenated to the column(s) I needed to force as text fields, dropping the prefix and old column along the way
- And then when the new field was passed to R - as a text datatype - used a gsub to replace TF- with and empty string...leaving me with the original ID field.
I've seen other R packages allow for the datatype control on input, so didn't know if that was an option available, or perhaps in the works.
Again, thanks for your input. It confirmed my direction and solution.
@jaeW_at_Onyx wrote:@kelly_tagtow if it were me, I would add a text character in front of the Donor ID upon initial ingestion into Domo.
That way you're confident that at ANY PART of the pipeline in Domo (whether Magic, R, or Analyzer), the data gets treated appropriately and no truncation happens.
If you're worried about mangling the data, you could have two columns, Donor_ID, Donor_ID_text.
I know it's not the answer to your question, but it is what I would recommend to my clients.
0
Answers
-
What data type is the column stored as on the dataset within Domo?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
@GrantSmith It is a Text field in Domo
0 -
@kelly_tagtow if it were me, I would add a text character in front of the Donor ID upon initial ingestion into Domo.
That way you're confident that at ANY PART of the pipeline in Domo (whether Magic, R, or Analyzer), the data gets treated appropriately and no truncation happens.
If you're worried about mangling the data, you could have two columns, Donor_ID, Donor_ID_text.
I know it's not the answer to your question, but it is what I would recommend to my clients.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Thank you @jaeW_at_Onyx . That is what I did to solve this situation yesterday:
- Create a new column of a simple text field prefix (TF-)
- Concatenated to the column(s) I needed to force as text fields, dropping the prefix and old column along the way
- And then when the new field was passed to R - as a text datatype - used a gsub to replace TF- with and empty string...leaving me with the original ID field.
I've seen other R packages allow for the datatype control on input, so didn't know if that was an option available, or perhaps in the works.
Again, thanks for your input. It confirmed my direction and solution.
@jaeW_at_Onyx wrote:@kelly_tagtow if it were me, I would add a text character in front of the Donor ID upon initial ingestion into Domo.
That way you're confident that at ANY PART of the pipeline in Domo (whether Magic, R, or Analyzer), the data gets treated appropriately and no truncation happens.
If you're worried about mangling the data, you could have two columns, Donor_ID, Donor_ID_text.
I know it's not the answer to your question, but it is what I would recommend to my clients.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive