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

Multiple Contains, possible to enter a dynamic range for contains?

wonka1234
10 - Fireball

hi,

 

I have an analytic app where a user enters in the month and year like so : 202209 , 202210 etc.

 

Is it possible to adjust this to a range?

 

wonka1234_0-1666980213585.png

 

wonka1234_1-1666980227586.png

wonka1234_2-1666980240669.png

wonka1234_0-1666980411963.png

 

 

Is there anyway to adjust this so I can type in  202207-202209  or any of those?

 

2 REPLIES 2
kathleenmonks
Alteryx
Alteryx

Hi @wonka1234,

 

If you have a specific set of values that you want to use, I would suggest using a list box interface tool instead. You can manually set values or choose from an external source and the user can select multiple or just one date. Then you can generate a custom list with a comma separator to replace the portion of the contains formula.

danilang
19 - Altair
19 - Altair

hi @wonka1234 

 

You can make this work by restructuring your filter to include the range and then adding a formula to the Action tool to replace the two months

 

danilang_0-1667047695619.png

danilang_2-1667047807979.png

 

If the hyphen is there, the formula replaces the "202210" with the left part and "202211" with the right part.  If there's no hyphen, it replaces both "202210" and "202211" with the left part.  The main drawback in this approach is that it expects the user to type correctly.  The workflow contains a simple Error Message tool to ensure that only one of the two allowed formats is used

danilang_3-1667048483030.png

 

  

 

@kathleenmonks' suggestion is cleaner since it doesn't allow the user to make mistakes in type, but unless you read the month values dynamically from and external source, you'll have to redeploy the workflow when the list of months in the tool is no longer valid.    You'll also need to change your filter to use IN instead of Contains [Month] in ("202209","202210") and replace everything in the brackets 

 

Dan

 

Labels