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

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
ACE Emeritus
ACE Emeritus

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
ACE Emeritus
ACE Emeritus

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
ACE Emeritus
ACE Emeritus

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