SOLVED
How to remove columns that are all zeros
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
acaryasin01
8 - Asteroid
‎07-27-2022
11:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I have a large data set that has a number of columns that are just all zeros and I want to remove these field.
If there is anything other than zero in the column, it is useful and I would like to keep it. Sample input and output below.
Thanks in advance.
Input | |||
Order # | A | B | C |
1001 | 0 | 5 | 0 |
1002 | 0 | 0 | 0 |
3302 | 0 | 0 | 2 |
4507 | 0 | 1 | 1 |
Desired Output | |||
Order # | B | C | |
1001 | 5 | 0 | |
1002 | 0 | 0 | |
3302 | 0 | 2 | |
4507 | 1 | 1 |
Solved! Go to Solution.
Labels:
- Labels:
- Workflow
3 REPLIES 3
DataNath
17 - Castor
‎07-28-2022
12:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @acaryasin01, here's how I'd go about it. The Data Cleanse tool has the option to remove fully null columns, as well as replace numeric nulls with 0 and therefore I just temporarily made all 0s into nulls in the step before to then push the data through this tool and get the expected outcome.
‎07-28-2022
12:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Perfect, thank you @DataNath much appreciate .
flying008
15 - Aurora
‎07-28-2022
12:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator