Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to pass Parameters at run-time?

Rekha
5 - Atom

I have a table which holds data for various years. Is there a way that I can fetch only one specific year's data for processing during run-time without hard coding the year?

Example, when I run a workflow I should get a pop up asking to pass the year and once I type it in (Eg: 2015) it should fetch only those records belonging to 2015 from the Database(SQL Server).

3 REPLIES 3
s_pichaipillai
12 - Quasar

@Rekha

 

convert you workflow into App then add interface to the workflow and connect to the Filter tool and update the action to the value provided thru GUI

 

 

s_pichaipillai
12 - Quasar

May be this example would help you

 

i am using Adventure works database and using the below query for WorkOrder Table. 

Note: my filter for this query is YEAR(startdate). this is the value can be dynamically set in Alteryx

SELECT   [WorkOrderID]
      ,[ProductID]
      ,[OrderQty]
      ,[StockedQty]
      ,[ScrappedQty]
      ,[StartDate]
      ,[EndDate]
      ,[DueDate]
      ,[ScrapReasonID]
      ,[ModifiedDate]
  FROM [AdventureWorks OLTP].[Production].[WorkOrder]
  WHERE YEAR([StartDate])='2006'

Add the Text box from interface tools and connect to the Input tool whcih we used for SQL connection 

and in Action update the value and replace the 2006 for the where clause query 

Year.PNG

take a look at the sample and let me know if this works

Rekha
5 - Atom

Thank you. It helped. :)

Labels