Alteryx Designer Desktop Discussions

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

Creating dynamic quarterly date ranges to be used for analysis later

HadiElmo
5 - Atom

I am doing a quarterly analysis and need to be able to define quarterly dates which are used later for calculating things like premium earned between the two date ranges, the policy coverage period between those two date ranges etc. I know you can create user variables, which is what I did to create a variable called user.valuation_start_date = 12/31/2016 (this date will change in the future). For now I am looking to create more quarterly variables such as year1q1 = 3/31/2017, year1q2 = 6/30/2017, on and on until you get to 12/31/2023 (this date will change in the future as well). 

 

I will then need to perform procedures like calculate how many days was the policy active for between year1q2 and year1q3 and get the number of dates - this part is easy i can just use the datetimediff function, but I am trying to explain how I will use those quarterly defined dates. 

 

Thanks in advance!

1 REPLY 1
aatalai
14 - Magnetar

@HadiElmo assuming you are starting with a field in date format already, put this into a formula tool

 

datetimeformat([date field],"%Y")+"q"+tostring( ceil(datetimemonth([date field])/3,1))

 

let me know how you get on

Labels