Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

How to allow user to select value from drop down and then use that value in formula tool

chasekapitzky
5 - Atom

Hello, I have attached a packaged pseudo-workflow to aid in what I am trying to do. Basically, I am trying to create a workflow app that allows a user to select a value from a drop down list. This would then be followed by a Formula tool, which would calculate an IF / THEN formula based on whatever the user selected from the drop down list. Is this possible? I outlined what I am trying to do in the packaged workflow (image below). Thank you!

 

 

Alteryx Screenshot.JPG

5 REPLIES 5
patrick_digan
17 - Castor
17 - Castor

@chasekapitzky There are a number of ways to do this. Here are 2 ways that I've included in the attached.

 

1) Write a formula like this:

IF "%Question.Drop Down (3)%" = 'Calendar' THEN DateTimeYear([OrderDt])
ELSEIF "%Question.Drop Down (3)%" = 'Fiscal' THEN DateTimeYear([OrderDt]) + 1
ELSE Null()
ENDIF

This syntax is called a reference shortcut.

 

2) Connect the drop down to the formula tool and write a formula like:

IF [#1] = 'Calendar' THEN DateTimeYear([OrderDt])
ELSEIF [#1] = 'Fiscal' THEN DateTimeYear([OrderDt]) + 1
ELSE Null()
ENDIF

For completeness sake, the third option would be action tools. I personally like options 1 and 2 better than action tools, but I may be biased.

chasekapitzky
5 - Atom

Patrick, thanks a lot for your reply! When I try to open the file, I am unable to as you had saved it in a more recent version of Alteryx than our company has. Would it be possible for you to somehow "down-grade" the packaged workflow? We are using 11.7.4. Thanks!

chasekapitzky
5 - Atom

Actually, I may not need the packaged workbook after re-reading your post. I'll take a shot at your first 2 solutions now. I'll check back in shortly...

patrick_digan
17 - Castor
17 - Castor

@chasekapitzky Here you go!

chasekapitzky
5 - Atom

Patrick, thank you again! And I really appreciate the down-saved workflow. Your solution worked perfectly and I will mark it as such right now. Thank you very much!

Labels
Top Solution Authors