Alteryx designer Discussions

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

Can a Workflow Constant be used as an Input Data Tool Criteria?


Easy example, I've got a StartDate and an EndDate for the select criteria, which would be "WHERE AGING_DATE Between Startdate and EndDate". I'm trying to avoid having users go into the Input Data Tool EVER... their grubby little hands will mess everything up.


Since there doesn't seem to be a way to pop-up a user input window at runtime, to make the criteria variable, I'm trying the route of setting all of the constants that I need and then just referencing them from within the Input Data Tool. That keeps the user from going into the query, itself - they just have to change the constants from one run to the next.


Is this possible?


This absolutely works!

As an example, if you have a User constant named "Startdate" and one named EndDate you could use the following


WHERE AGING_DATE Between '%User.Startdate%' and '%User.EndDate%'

You could also use a Declare statement and set each value using the same syntax eg:

Declare @Startdate Date
Set @Startdate = '%User.Startdate%'

Thanks for posting this solution.  Huge help!