How can I separate the numeric data in a column from the non-numeric data?
I have data which I need to clean up.
The data is a mix of numeric and non-numeric variables. I want to pull out all the non-numeric variables, replace them with 0s, and then convert the entire column from a text format to numeric format.
Can't figure out how to do this. . .
Comments
-
If you go to the Magic ETL tool, and set up a new dataflow, you can fix this in the dataflow by adding the text formatting transform (which is found under edit data) and setting the second option (How should numbers be handled) to "Only show Numbers", and leave the first untouched. Then, add the transform Set Column Type and set it to the number format of your choosing (whole number or decimal). That should eliminate all the non-numerics, just leaving the numbers, so you can have the number sums. If you need the COUNT of the column, just have another feed that leaves the column untouched. Hope that helps!
1 -
I had a very similar problem and domo support created a beast mode field for each column of data that I was trying to summarize. Essentially they made made a filter to distinguish alpha from numeric characters and filtered out all alpha characters. You could use their logic to replace the alpha characters with 0's. Here is the beast mode calculation they used:
CASE
WHEN `Your Column` LIKE '%a%' THEN 'alpha'
WHEN `Your Column` LIKE '%b%' THEN 'alpha'
WHEN `Your Column` LIKE '%c%' THEN 'alpha'
WHEN `Your Column` LIKE '%d%' THEN 'alpha'
WHEN `Your Column` LIKE '%e%' THEN 'alpha'
WHEN `Your Column` LIKE '%f%' THEN 'alpha'
WHEN `Your Column` LIKE '%g%' THEN 'alpha'
WHEN `Your Column` LIKE '%h%' THEN 'alpha'
WHEN `Your Column` LIKE '%i%' THEN 'alpha'
WHEN `Your Column` LIKE '%j%' THEN 'alpha'
WHEN `Your Column` LIKE '%k%' THEN 'alpha'
WHEN `Your Column` LIKE '%l%' THEN 'alpha'
WHEN `Your Column` LIKE '%m%' THEN 'alpha'
WHEN `Your Column` LIKE '%n%' THEN 'alpha'
WHEN `Your Column` LIKE '%o%' THEN 'alpha'
WHEN `Your Column` LIKE '%p%' THEN 'alpha'
WHEN `Your Column` LIKE '%q%' THEN 'alpha'
WHEN `Your Column` LIKE '%r%' THEN 'alpha'
WHEN `Your Column` LIKE '%s%' THEN 'alpha'
WHEN `Your Column` LIKE '%t%' THEN 'alpha'
WHEN `Your Column` LIKE '%u%' THEN 'alpha'
WHEN `Your Column` LIKE '%v%' THEN 'alpha'
WHEN `Your Column` LIKE '%w%' THEN 'alpha'
WHEN `Your Column` LIKE '%x%' THEN 'alpha'
WHEN `Your Column` LIKE '%y%' THEN 'alpha'
WHEN `Your Column` LIKE '%z%' THEN 'alpha'
WHEN `Your Column` LIKE '%,%' THEN 'alpha'
ELSE 'numeric'
ENDHope this helps!
0 -
This is how I would go about this by using BeastMode.
CASE
WHEN `TableColumnName` Like '^[0-9]%' Then `TableColumnName`
ELSE 0
END
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive