Alteryx Designer Desktop Discussions

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

Application to update if statement bins/buckets from user input

aweldon1
6 - Meteoroid

Hi - I have attached an example of a process to create limits profiles out of of values. Essentially the formula tool uses an if statement to "bin" or "bucket" the limits into several categories/ranges. However, if a user wants to update this they will need to manually do so in the formula.

 

I'm familiar with creating applications and have made a few, but I'm wondering if there's a way to create an application that allows a user to input an excel file that has a list of the ranges they would like, and to have that update the formula tool accordingly. 

 

Any help would be greatly appreciated. 

 

Thank you!

3 REPLIES 3
ArtApa
Alteryx
Alteryx

Hi @aweldon1 - Please find attached app that will read ranges from a file that then are used to apply conditions. I'm not a big fan of long "if-then-else" statements though.

 

ArtApa_0-1597475361635.png

 

 

aweldon1
6 - Meteoroid

This is perfect, thank you! I have a couple questions, if you don't mind:

 

  1. How would you handle a category like "Greater than 500,000". Would you have to set the Limit End to an extremely large number to fit into the if statement, or is there a way to work in some sort of "infinite" Limit End?
  2. What do you not like about the "if else" statements? Is there an alternate route you would take?

 

Thanks again, this was so helpful!

ArtApa
Alteryx
Alteryx

Hi @aweldon1 - Please see my comments below:

 

1) In this case I'd leave "Limit End"=Null and I'd use "if-then-else":

 

if [Limit] >= [Limit Start] and [Limit] <= [Limit End] Then "Yes"
elseif
IsNull([Limit End]) and [Limit] >= [Limit Start] Then "Yes"
else
"No" endif

 

2) I like "if-then-else". I just do not like lengthy statements. These statements are difficult to understand and debug. This is my personal design preference.  

Labels