Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Remove columns based on a condition

yozveren
6 - 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

 

5 REPLIES 5
LordNeilLord
15 - Aurora

Hey @yozveren

 

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

 

Dynamic Select.PNG

StephenR
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
Principal Customer Support Engineer

NickC
Alteryx Alumni (Retired)

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

 

 

 

yozveren
6 - Meteoroid

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

MatthieuArzel
7 - Meteor

That's a clean way to do this. Thank you so much 🙂

Labels