Alteryx Designer Cloud Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Cloud.
SOLVED

I want to filter a column based on part of the date. Can you help?

My dataset contains records from all of 2017. There's a date column with the full date, for example: 2017-02-23. I want to filter my dataset so that it only contains records from a single month. How do I do this?

4 REPLIES 4
Trifacta_Alumni
Alteryx Alumni (Retired)

Hey there!

 

Give this a shot:

Keep rows [keep] on the condition MONTH(your_date_column) == 2

This will keep all of the values where you date column falls in February.

 

For more information on the keep transform, see here: https://docs.trifacta.com/display/PE/Keep+Transform

 

For more information on the MONTH( ) function see here: https://docs.trifacta.com/display/PE/MONTH+Function.

Where do I find that "keep rows" option?

Trifacta_Alumni
Alteryx Alumni (Retired)

Hello Toni,

Please refer to the steps below to find the "Keep rows" option,

  1. Highlight the year and month that you are interested in. For example, if you are interested in the entries in February, 2017, then highlight "2017-02" in the dates column
  2. Once it is highlighted, the suggestion cards will appear on the right side of the window
  3. Scroll down to the "Keep rows" section
  4. Select an option that suits your purpose and edit if necessary.
  5. For your case, I would suggest the "with values matching" option as it would include all the entries within the month
  6. Click edit if you would like to change the condition. Otherwise, click on add

 

Let me know if you would like further clarification on any of the steps above.

 

Happy Wrangling

Thanks everyone!