Alteryx Designer Desktop Discussions

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

How to select multiple months based on List Box Interface?

EYU07
7 - Meteor

I'm struggling with making selections on multiple months that are based on a List Box interface.  It's not returning any results for output after the filter.  I'm wondering if there are further tweaking in the setting.  Basically what I'm trying to accomplish here is that I have a set of data with posting dates, I want the workflow to return a list of summarized posting dates as an user interface, then filter the original data set by the dates that are selected by the users, and maybe add another output to return a list of selected months as my parameter record.  I tried to get some ideas from other posts but didn't quite get the workflow working.  Please help, thanks so much!

 

yyu3_0-1582222958138.png

yyu3_1-1582223057271.png

yyu3_2-1582223072947.png

 

4 REPLIES 4
CharlieS
17 - Castor
17 - Castor

Hi @EYU07 

 

Here's how I suggest going about this:

- Since you want the user to select the months they're interested in, we'll establish month as the basis for this UI/process.

- On the input data, we'll need to assign the month to each so we know what to filter. I use the following expressions to parse the [Posting Date] field and output the month in which it occurs:

 

DateTimeFormat(DateTimeParse([Posting Date],"%m/%d/%Y"),"%B")

 

- On the user interface: since there's only 12 months, we can set those 12 values in the tool manually. 

- Now that we have the user specifying the month value in the interface, and the data with the same month values assigned, the rest comes together nicely.

 

20200220-MonthFilterUI.png

 

 

 

 

 

 

 

 

 

Check out the attached workflow to see this in action. Let me know if you have any questions.

EYU07
7 - Meteor

Hi @CharlieS 

 

Thank you so much!  I think this works great if it's within the same year, but I will have multiple years of data for year-over-year comparison, which why I didn't try to list the months manually for UI selections.  I read in another post that the dates (in Date format) will be concatenated, and I got a parse error if I tried to select more than one month in the UI, and I'm not sure how to deal with this.  Any help is much appreciated!

 

yyu3_0-1582231663678.png

 

CharlieS
17 - Castor
17 - Castor

Ah, you probably have your List Box tool set to "Select Tool Mode". Change the setting to "Generate Custom List" and you should be good to go.

 

20200220-MonthFilterUI2.png

 

 

 

 

 

 

 

 

 

 

 

Additional Info:

The "Select Tool Mode" will provide an output that can be used by Select tools (and others) to update a field mapping. The value it passes has true/false assigned to each value and looks like this:

 

2019-01-31=False,2019-02-28=False,2019-03-31=False,2019-04-30=True,2019-05-31=True,2019-06-30=True,2019-07-31=False,2019-08-31=False,2019-09-30=False,2019-10-31=False,2019-11-30=False,2019-12-31=False

 

When you change this to "Generate Custom List" the output will be a concatenated list of values that were selected that looks like this:

 

"2019-06-30","2019-07-31","2019-08-31"

 

Helpful Tip:

if you're ever stuck on an expression error from something updated by an Action tool, set the Action tool to update a value in a Text Input tool and run the module in debug mode to see the value that the Action tool actually applies.

 

Access debug mode by opening the Interface Designer (Ctrl+Alt+D), go to the "Test View" wand icon, make your settings, and click "Open Debug", which is a workflow with all the Actions applied. 

EYU07
7 - Meteor

That precisely solved the problem!  I got the result I wanted, thanks so much for providing a solution and some great tips!

Labels