Alteryx Designer Desktop Discussions

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

How to create a date range interface that limits the min date and max date?

anil_m
8 - Asteroid

I want my user to select the  "from date" and "to date",  and i should be able to set the minimum date and maximum date limits.  Is it possible in Alteryx?

6 REPLIES 6
NicoleJohnson
ACE Emeritus
ACE Emeritus

Don't think there is a way to limit it within the tool, but you can add an Error Message tool to check that the date selected is between specific dates... that way if someone picks something outside those parameters, they will receive a warning letting them know which dates should be selected between (i.e. you can create the error message telling them the date parameters)?

 

NJ

MarqueeCrew
20 - Arcturus
20 - Arcturus

As @NicoleJohnson described, you can use the Error Message Tool to establish the limits for dates.  

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
anil_m
8 - Asteroid

@NicoleJohnson , @MarqueeCrew  

Thanks for the replies, I have used  Error tool, but its not working.  Am i doing correct here?date error.JPG

MarqueeCrew
20 - Arcturus
20 - Arcturus

are you looking for a past date only?

 

If this is true, then display error message, that's the expression that will cause the error to display.

 

Also, the input date is likely a DATE, while the datetimenow() needs to be formatted as  %Y-%m-%d.  Otherwise, you might have a problem.

 

[#1] < DateTimeFormat(DateTimeNow(),"%Y-%m-%d")

Capture.png

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
NicoleJohnson
ACE Emeritus
ACE Emeritus

When you say that it isn't working, are you testing it as an app and it isn't working? i.e. using the "magic wand" icon next to the Run button and seeing if the error message pops up after selecting a date after today's date? What specifically are you seeing that isn't working? If you just run the workflow (rather than the "wand"), nothing will appear in your workflow results, have to run it as an app.

 

Also, I see you are using DateTimeNow() in your formula rather than DateTimeToday(). It appears to work both ways (or at least it will if you format it like @MarqueeCrew!), but when I'm not comparing time in a workflow, I usually opt for DateTimeToday() to return just the date instead of the datetime.

 

NJ

anil_m
8 - Asteroid

@NicoleJohnson ,  yes i am running with "magic wand", but i forgot click finish, I taught it will display error message as soon as i select wrong option.  Thanks for your time. 

Labels