# Changing the month by itself

**URL:** <https://community.parabola.io/t/changing-the-month-by-itself/452>\
**Category:** Ask a question\
**Created:** [May 6, 2020, 5:12pm UTC](https://community.parabola.io/t/changing-the-month-by-itself/452 "2020-05-06T17:12:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cary\_Wan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/cary_wan/32/276_2.png) [@Cary\_Wan](https://community.parabola.io/u/Cary_Wan)\
**Post date:** [May 6, 2020, 5:12pm UTC](https://community.parabola.io/t/changing-the-month-by-itself/452/1 "2020-05-06T17:12:56Z")

</div>

Hello, Parabola community of smart people! 😃

Wondering if you have a solution…

I have a flow that formats a spreadsheet to only show transactions that closed last month.

How I’m doing it now is hard coding that month in. For example, we’re in May (month 5) right now, so last month is April (month 4) and I edit my flow this month (and once every month) to change this number to 4: [https://d.pr/i/lz8lnj](https://d.pr/i/lz8lnj)

Anybody have an idea on how to automate it?

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/brian/32/11_2.png) [@brian](https://community.parabola.io/u/brian)\
**Post date:** [May 6, 2020, 8:11pm UTC](https://community.parabola.io/t/changing-the-month-by-itself/452/2 "2020-05-06T20:11:33Z")

</div>

Hey Cary!

Perhaps this would be a good place to use the Date Comparison step, and set the units to Months between your date and today. That should give you between 0 an 1 for dates in the current month, which you can then filter by.

Let me know if that is on track.

---

<div class="post-metadata">

**Author:** ![Cary\_Wan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/cary_wan/32/276_2.png) [@Cary\_Wan](https://community.parabola.io/u/Cary_Wan)\
**Post date:** [September 22, 2020, 7:25pm UTC](https://community.parabola.io/t/changing-the-month-by-itself/452/3 "2020-09-22T19:25:25Z")

</div>

Hey Brian! Thanks for the tip! Good start, but it doesn’t work out in a scenario where today is 9/22 and let’s say the subject dates are 8/29 and 9/1. Using that formula, the months in between for both is less than 1, but it wouldn’t be enough of a distinction to determine last month or this month 🙁

---

<div class="post-metadata">

**Author:** ![sachi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/sachi/32/10_2.png) [@sachi](https://community.parabola.io/u/sachi)\
**Post date:** [September 22, 2020, 10:52pm UTC](https://community.parabola.io/t/changing-the-month-by-itself/452/4 "2020-09-22T22:52:29Z")

</div>

Hey @Cary_Wan - Do you imagine you’d like to run this flow at the beginning of every month to show the transactions that were closed last month? I’ve been thinking about a few different ways to do this. It’s a little tricky because our `Insert Date & Time` step has an offset feature which I can only offset by day and we need to account for when you’re running the flow in January and need it to also be looking at the previous year.

Here’s something I came up with that should be pretty durable:

 ![Screen Shot 2020-09-22 at 3.45.29 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/629545104b8057f05bdb75d110643e4a9ce65d14.png)

1. Use `Insert date & time column` and create a new column, Current DateTime with no offset
2. Use `Format dates` and format the following columns:  
 ![Screen Shot 2020-09-22 at 3.37.54 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/bbae4378fc12d201e78af3da84f78da7e41a4be3.png)  
 ![Screen Shot 2020-09-22 at 3.37.32 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/0a2df33bffb092b4ca322ccde817997446002fe6.png)
3. Then we’ll create two branches with the `Remove rows` step. One where “Current month” does not equal 1 (meaning “not January”) and another where "Current month does equal one (meaning “January”  
).
4. From the top “not January branch”, your `Insert math column` step looks like this:  
 ![Screen Shot 2020-09-22 at 3.47.00 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/0bac5fea5580e081e435e46556d310e653e2998f.png)
5. Your `Insert If/Else column` step should be configured like this:  
 ![Screen Shot 2020-09-22 at 3.47.43 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/04e3c1e6cedfc8a48bc904bcc6e53822dee2c379.png)
6. Then, your `Remove Rows` step will filter for rows where `Last month? = yes`  
 ![Screen Shot 2020-09-22 at 3.47.59 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/46ad01f4323df43d23e1fa895a891f4a2e9e6a0b.png)
7. For your bottom “January branch”, your `Insert math column` step would look like this so that we can make it match December of the previous year:  
 ![Screen Shot 2020-09-22 at 3.48.50 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/16e3ce0f0eaf053fe3028ca3b0c144edb82947f5.png)
8. Your `Insert if/else column` will be set up like this:  
 ![Screen Shot 2020-09-22 at 3.50.12 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/3e608eccdc3c58656c2fda8466f9c22dae9bd00d.png)
9. Finally, the `Remove rows` step should look like this:  
 ![Screen Shot 2020-09-22 at 3.50.26 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/e86429187c7a9aa3980a38bec8e0adfa7c01c75b.png)

This might be a little overkill for your automation, but it should be something you can fully automate. Let me know what you think!
