Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
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
ACE Emeritus
ACE Emeritus

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