Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to get last date of a month when I have just year and month in separate fields

shravanvijayaprasad
8 - Asteroid

How to get last date of a month when I have just year and month in separate fields as string? For example, I have month as 1 and year as 2019 and I want to get the last date for this (which is 31). If I have month as 2 and year as 2019, I want to get 29

 

Input data

MonthYear
12019
22019
32019

 

Output data required

MonthYearLastDate
12019

31

2201929
3201931
2 REPLIES 2
Greg_Murray
12 - Quasar

Hi, 

 

 

You can you do this with a series of formulas.

  1. Create the first date for the month and year given
  2.  Add one month to get the first date of the next month
  3. Subtract one day from that date

Greg_Murray_0-1582126901749.png

 

afv2688
16 - Nebula
16 - Nebula

Hello @shravanvijayaprasad,

 

this is one created for 2020. You only need to input the first day of the year on the first formula.

 

Regards

Labels