Alteryx Designer Discussions

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

Find last day of the previous quarter

BosKev
8 - Asteroid

Hi All,

 

Below gives me the 1st day of the current quarter I just want to subtract by 1 day to get to previous quarter or if there is a better way to write this.

 

Left(DateTimeToday(),5)+
PadLeft(ToString(3*Floor((DateTimeMonth(DateTimeToday())-1)/3)+1,0),2,"0")+"-"
+ "01"

 

Thanks,

BosKev

3 REPLIES 3
jdunkerley79
16 - Nebula
16 - Nebula

I would do:

DateTimeAdd(
    Left(DateTimeToday(),5)+
    PadLeft(ToString(3*Floor((DateTimeMonth(DateTimeToday())-1)/3)+1,0),2,"0")+
    "-01",-1,"days")

 

BosKev
8 - Asteroid

Thanks, wasn't completely sure all the components in the functions as i got it from another discussion, will look it up later.

Anjali03
5 - Atom

Hi,

 

Could you please share the expression to find first day of previous Quarter.

Labels