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

Alteryx Designer Desktop Discussions

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

Dropdown box to select a specific day then run 2 filters

StephenT
8 - Asteroid

Hi all

 

I am looking for a way to simplify a workflow based on people leaving my firm and add a dropdown box or 2 to select a day, then use a date range to select the required data  (if that make sense).

 

I presently have, in my workflow, multiple filters, as below :

 

  • datetimeformat(DateTimeNow(),"%a") = "Mon"
  • datetimeformat(DateTimeNow(),"%a") = "Tue"
  • datetimeformat(DateTimeNow(),"%a") = "Wed"
  • datetimeformat(DateTimeNow(),"%a") = "Thu
  • datetimeformat(DateTimeNow(),"%a") = "Fri"

Each of the 'day' filters then runs another 2 filters to output data  based on the current week, and the following week (need to be seperated).

 

For the Monday filter I then run 2 seperate filters

  • ([Departure Date] >=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +1,"days"), '%Y-%m-%d') AND [Departure Date] <=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +7,"days"), '%Y-%m-%d'))
  • ([Departure Date] >=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +8,"days"), '%Y-%m-%d') AND [Departure Date] <=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +14,"days"), '%Y-%m-%d'))

For the Tuesday filter I then run 2 seperate filters

  • ([Departure Date] >=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +0,"days"), '%Y-%m-%d') AND [Departure Date] <=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +6,"days"), '%Y-%m-%d'))
  • ([Departure Date] >=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +7,"days"), '%Y-%m-%d') AND [Departure Date] <=
    DateTimeFormat(DateTimeAdd(DateTimeToday(), +13,"days"), '%Y-%m-%d'))

the same applies for the rest of the week (excluding Weekends)

I'm looking to implement the dropdown box so my team members can select Monday, then the workflow uses the appropriate filters 2 filters, or if the day is Tuesday then run the appropriate filters.

 

Is this possible ? Any suggestions or recommendations would be greatly appreciated.

 

My apologies if my questions are vague.

9 REPLIES 9
StephenT
8 - Asteroid

I've attached a screenshot of the date filters

StephenT_0-1613096179923.png

 

pedrodrfaria
13 - Pulsar

Hi @StephenT 

 

An easy solution would be to have the user select in the dropdown menu "Monday" for example, then this dropdown updates a Text Input, then with a append fields, you populate the dataset with Monday and the filter you have uses Monday as the factor to move forward with the workflow.

 

I attached an workflow to cover the concept.

 

Pedro.

StephenT
8 - Asteroid

Thanks @pedrodrfaria 

Unfortunately i can't open your sample.

I am using Ver 2019.3.5.17947 if that helps

Vijuzy
8 - Asteroid

Hi @StephenT ,

 

You can use interface tools to get user input and update it within workflow and use it in formulas. I have provided an example workflow and made it compatible with 2019 version of Alteryx. Hope it helps.

 

Regards,

 

Vijay

pedrodrfaria
13 - Pulsar

Hi @StephenT 

 

Right click on the wf from your windows explorer, open as a notepad and change the version to your version. Then you will be able to open it.

 

Pedro.

StephenT
8 - Asteroid

Thanks so much @pedrodrfaria 

I managed to open the WF and had a look at the steps.

 

A couple of things I can't quite work out :

 

  • When does the WF prompt for the select of the day (I run the WF on Mon and Thurs, but will eventually have to run it daily, with different date filters) ?
  • Where do I insert the date filter selection ?

Thanks again for your help

pedrodrfaria
13 - Pulsar

Hi @StephenT 

 

You need to run as an App, then you will see the dropdown menu:

 

You can use either the Drop Down, the Text Box or the Date tool, all from the interface tools in order to make the App work.

 

pedrodrfaria_0-1613431237205.png

 

pedrodrfaria_1-1613431302445.png

 

Pedro.

 

StephenT
8 - Asteroid

Hi again @pedrodrfaria and @Vijuzy 

 

I've had another look at your WF and have worked out I wasn't running them as an "Analytic App", which I've now fixed, but can't see how to make the dropdown box select the filters based on the "day' selection per the examples below

 

  • If Monday run these 2 filters :
    • Filter 1
      • ([Departure Date] >=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), +1,"days"), '%Y-%m-%d') AND [Departure Date] <=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), +7,"days"), '%Y-%m-%d')) OR [Date Completed] >=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), -4,"days"), '%Y-%m-%d') AND [Date Completed] <=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), -3,"days"), '%Y-%m-%d'))
      • Then output data as final step
    • Filter 2
      • ([Departure Date] >=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), +8,"days"), '%Y-%m-%d') AND [Departure Date] <=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), +14,"days"), '%Y-%m-%d'))
      • then output data as final step

 

  • If Tuesday selected run these filters:
    • Filter 1
      • ([Departure Date] >=DateTimeFormat(DateTimeAdd(DateTimeToday(), +0,"days"), '%Y-%m-%d') AND [Departure Date] <=DateTimeFormat(DateTimeAdd(DateTimeToday(), +6,"days"), '%Y-%m-%d'))
      • Then output data as final step
    • Filter 2
      • ([Departure Date] >=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), +7,"days"), '%Y-%m-%d') AND [Departure Date] <=
        DateTimeFormat(DateTimeAdd(DateTimeToday(), +13,"days"), '%Y-%m-%d'))
      • Then output data as final step

I currently have 5 separate filters for each weekday (similar to the above), and hoping to consolidate/tidy the process making it less confusing for my colleagues, eliminating 4 of the day selections, using the dropdox box selection/s

I hope that explains my wokflow a bit better

StephenT
8 - Asteroid

Hi again @pedrodrfaria 

When I run the Analytics App tool, I get the following popup box

StephenT_0-1613433858648.png

 

Labels
Top Solution Authors