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

Fetching number of days in a month

zohairraza
5 - Atom

Hey yall!

 

I need help figuring out how to fetch the total number of days in a month for each month in a year.

 

Appreciate yall! 

5 REPLIES 5
JosephSerpis
17 - Castor
17 - Castor

Hi @zohairraza you can use a generate row tools to create every day between a start and end date and then you can use datetime function to extract the Month and Year and then you can summarise the data to get the total days by month and year. Have attached a workflow to showcase this. This help article is always handy to have when working with dates in Alteryx.

JagdeeshN
12 - Quasar
12 - Quasar

@zohairraza ,

 

You can possibly use the formula to calculate this:-

 

DateTimeFormat(DateTimeAdd(DateTimeAdd(DateTimeTrim([Field1],"month"),1,"month"),-1,"day"),"%d")

 

It trims the date mentioned to the month. It then adds a month, subtracts a day, and formats the datetime string to show just the day

 

Hope this helps.

 

Best,

Jagdeesh

zohairraza
5 - Atom

Youre awesome! Thank you!

PhilipMannering
16 - Nebula
16 - Nebula

I think this is a better solution,

PhilipMannering_0-1650308658888.png

 

Hope this is useful

Labels