We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
fireworks
SOLVED

How to dynamically drop columns if they add no value

asadh99
6 - Meteoroid

I am working on a dataset in which I would like to keep a historical record of every time a vehicle has last been inspected.

 

However there are certain instance where the "previous date completed" column is not very useful.

 

It either contains dates that are already recorded in the newest report or no data at all. 

 

If that is the case I would like to dynamically drop that column without having to use the select tool and manually inspect each record.

 

If however there is a date in the "previous date column" that is not captured in the newest report I want to keep that column in the final output.

 

I have tried using a multi field formula to capture if the column adds no value and if all the values are = 1 then I'd want to drop that column.

 

I'm sure there's a much easier way of accomplishing my goal.

 

Any tips or help would be greatly appreciated.

14 REPLIES 14
asadh99
6 - Meteoroid

I'm sorry I am new to Alteryx. I am unable to save it as a yxzp as of now. But I can provide you the spreadsheet. Here is an example. The output I would want is for the previous date column to be dropped as it doesn't add value. Thanks for your help.

alexnajm
18 - Pollux
18 - Pollux

That works, thank you! What is the logic then to drop the column? Because the dates are either equal to the [Date Complete] or null?

asadh99
6 - Meteoroid

I figured out how to export the workflow here it is. And yes, because the previous date column either has information already recorded in the new report or has null information where the new report has information. The only reason to keep that column would be in instances where there is a date in that column that isn't reflected in the new report. For example in the previous date column we have 5/2/2023 and then in the new  date  column we have 6/2/2024 because a new inspection was completed for the same vehicle a year later.

alexnajm
18 - Pollux
18 - Pollux

Here's a solution - it clears out values if there is a matching value or if it's null, and filters out those records. If there are records, the column will stay - if not, it will be removed.

asadh99
6 - Meteoroid

Thank you!

Labels
Top Solution Authors