6/17/21: We have completed maintenance for the Search functionality on the Community. If you are seeing any issues, please try to clear your cache first. If the issue persists please email Community@alteryx.com

Alteryx Designer Discussions

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

Selection Tool Automation

ayadav8
8 - Asteroid

Hey,

 

I have a file which contains date columns of both historical and forecast. My objective is to automate the process of selecting only the forecast (future) columns. For example: If I am running the workflow in Nov'17, the tool should select all the columns after and including Nov'17. Right now I am selecting the columns manually. Is there anything which can automate this?

 

Thanks!

7 REPLIES 7
JoshKushner
12 - Quasar
You can do this with the Transpose Tool.

After your data, add record ID's, transpose with recordID as a key field, filter all rows with name before Nov17 (orwhatever you want), cross tab back grouping by recordID
jdunkerley79
16 - Nebula
16 - Nebula

You could use a Dynamic Select with a formula:

[Name]>DateTimeToday()

Sample attached

ayadav8
8 - Asteroid

@jdunkerley79 The idea is great. However, I want to select only the coming one year months. Can I do that? My file has coming 24 months fields. How can I select only the next 12 months. i.e Nov'17 - Oct'18

Note: The present month is to be included in the selection.

 

Thanks!!

jdunkerley79
16 - Nebula
16 - Nebula

Try:

[Name]>=Left(DateTimeTrim(DateTimeToday(), "Month"),10)
AND
[Name]<Left(DateTimeAdd(DateTimeTrim(DateTimeToday(), "Month"), 12, "Month"),10)

I think that should work

ayadav8
8 - Asteroid

@jdunkerley79 this worked for date selection but it did not select the general fields like "Product Name" and "Product group". I would need that too apart from months. Thanks!

jdunkerley79
16 - Nebula
16 - Nebula

Can you drop a list of sample column names then I can tune for you.

 

 This expression should only dynamically filter dates:

!REGEX_MATCH([Name],"\d{4}-\d{2}-\d{2}")
OR
([Name]>=Left(DateTimeTrim(DateTimeToday(), "Month"),10)
AND
[Name]<Left(DateTimeAdd(DateTimeTrim(DateTimeToday(), "Month"), 12, "Month"),10))

Hopefully should work for you.

ayadav8
8 - Asteroid

There is only one column "StockNo"

Labels