Changing the month by itself

Hello, Parabola community of smart people! :smiley:

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

Anybody have an idea on how to automate it?

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.

1 Like

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 :slightly_frowning_face:

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:

  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:

  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:
  5. Your Insert If/Else column step should be configured like this:
  6. Then, your Remove Rows step will filter for rows where Last month? = yes
  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:
  8. Your Insert if/else column will be set up like this:
  9. Finally, the Remove rows step should look like this:

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

1 Like