Alteryx Designer Desktop Discussions

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

Dynamic Select Prior 12 Months

jsamstad
7 - Meteor

Hello! Is there a way to incorporate a date table so that I can dynamically select the prior twelve periods given the today is in the most recent period (202403) ? The table is cut short given the table limitation in the message, but imagine the columns go past 202307.

 

Thanks in advance!

 

 

Class ID202403202402202401202312202311202310202309202308202307
123105151052010520
45651050530101010
5 REPLIES 5
BrandonB
Alteryx
Alteryx
 

I like to transpose, parse out the month, and use a Sample tool for the first 12 records grouping by the ID column, and then crosstab back. Workflow is attached, but I think this is a relatively elegant solution without many tools. Technically you don't even need the parse out the month, but I did so just in case you needed to do additional adjustments. For example, you could use a sort tool after the formula to ensure that the months are in ascending order just in case your columns aren't ordered as they are now. 

 

 

Dynamic selection.png

jsamstad
7 - Meteor

Nice! I adapted it as there are periods in front of the current period which I failed to mention. Thank you!

BrandonB
Alteryx
Alteryx

Awesome glad to help!

SPetrie
13 - Pulsar

A dynamic select tool with formulas may also work for you.

DateTimeParse([Name]+"01","%Y%m%d") >= datetimeadd(DateTimeFirstOfMonth(),-12,"months") or [Name]="Class ID"

dynamic select.PNG

jsamstad
7 - Meteor

That is slick!

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels