Alteryx Designer Desktop Discussions

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

Date Logic

navya123
5 - Atom

Hi All,

Can anyone please explain me the logic for this two formulas which was mentioned in screenshot, where as it is displaying the start quarter date and end quarter date, but i didnt understood the logic behind this formulas. please help me to understand this logic

 

Start of Qtr (new column created in formula tool)

DateTimeAdd((left(DateTimeToday(),5) + PadLeft(ToString(ceil(DateTimeMonth(DateTimeToday())/3) *3-2),2, '0') + '-01'), -3, 'months')

 

 

End of Qtr (new column created in formula tool)

DateTimeAdd(DateTimeTrim(left(DateTimeToday(),5) + PadLeft(ToString(ceil(DateTimeMonth(DateTimeToday())/3)*3),2, '0') + '-01', "lastofmonth"), -3, 'months')

 

result

Start of QtrEnd of Qtr
01-07-2023 00:0030-09-2023 23:59
01-07-2023 00:0030-09-2023 23:59
01-07-2023 00:0030-09-2023 23:59
01-07-2023 00:0030-09-2023 23:59
1 REPLY 1
ed_hayter
12 - Quasar

Ive taken a go at this although this would need to be validated:

image.png

 

More general advice is for work like this one should start from the inner most brackets and break it down into component parts before working outwards to other parts of the formula

Labels