Start Free Trial

Alteryx Designer Desktop Discussions

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

Date formula question (calculating prior month, range of prior months)

adriennelenker
7 - Meteor

alteryx

 

Hello,

 

I have a date formula question I am running into difficulties with. I am have a dataset where one column contains dates. The dates are the last day of the month, all months from Jan 2020 until Dec 2022. For ex, there are 2020-01-01, 2020-02-02 etc all the way until 2022-12-31, so 36 months in total.

 

I have a user input tool and action tool connected to a formula tool. The current input date is 2022-12-31.

 

 

While the dates include the day, I really only need a formula that picks the right months. I am trying to create formulas in which, given the current input date, do the following:

 

 

  1. Given current input date, obtain prior month. So write a formula to obtain Nov 2022 (2022-11-30) from Dec 2022. (2022-12-31)
  2. Given current input date, obtain month 13 months prior. So write a formula to obtain Nov 2021 (2021-11-30) from Dec 2022. (2022-12-31)
  3. Given current input date, obtain the range “All 12 months before the current month” So a formula to select all records from Dec 2022 through Nov 2022.

 

I appreciate any help. Thanks

 

 

1 REPLY 1
binu_acs
21 - Polaris

@adriennelenker I think you need filter tools instead of formula tool, I created a workflow based on your requirement. I used the date tool instead of text tool

binuacs_0-1677367522876.png

 

 

 

 

 

Labels
Top Solution Authors