Hi - I have a date 12-11-2017. What would the expression be to return the start and end of the quarter? I am primarily focused on getting the quarter end for any given date, but could see having the beginning helpful too. Thanks!
Input:
12-11-2017
Output:
Start: 10/1/2017
End: 12/31/2017
Solved! Go to Solution.
Assuming you have the date as an Alteryx date I suggest:
Start of Quarter:
Left([Parsed],5) +
PadLeft(ToString(Ceil(DateTimeMonth([Parsed])/3)*3-2),2, '0')
+ '-01'
End of Quarter:
DateTimeTrim(Left([Parsed],5) +
PadLeft(ToString(Ceil(DateTimeMonth([Parsed])/3)*3),2, '0')
+ '-01', "lastofmonth")
Sample attached
awesome. thank you!
to follow up with an add on question, do you know if there is a way to calculate the # of days in a quarter?
so if its 3/31, 6/30,etc. - is there an expression to calculate how many days are in that quarter?
thanks!
Hi @cireost
Yes! The DateTimeDiff function can tell you the number of days between two dates
DateTimeDiff(Later date, earlier date, "days")
Let me know if that helps.
Cheers!
Esther
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |