community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Remove columns based on a condition

Highlighted
Meteoroid

Hello all,

 

Here's what I am trying to do. I have several columns (consider 2019 as 2018):Sans titre.jpg

 

And I want to delete columns based on the current month. Today being 9 August 2018, the workflow would ideally delete the columns prior to that date, meaning 2018-03-01, 2018-04-01, 2018-05-01, 2018-06-01 and 2018-07-01.

 

 

 

Is it easily possible ? If the only solution is a complex one, I would gladly use it as well.

 

Thanks

 

Alteryx Certified Partner

Hey @yozveren

 

I would look to use the dynamic select tool with a set up like this:

 

Dynamic Select.PNG

Alteryx
Alteryx

Use the Dynamic Select tool set to Select Via Formula with the below formula:

 

Left(Replace([Name],"-",""),6)>=Left(Replace(DateTimeToday(),"-",""),6)

 

Regards,
Stephen Ruhl
Customer Support Engineer

Alteryx
Alteryx

Hello,

 

You could use the dynamic select to do this in a single tool.  I prefer to use a couple of tools as the logic becomes more transparent.  I would transpose all the columns and use a custom filter tool, to filter out any dates greater than today's date, then cross tab back into the original format.  V2018.2 workflow attached.

dynamic select columns.png

 

 

 

Meteoroid

Thank you all for your answers, gave me creative ideas !

Labels