Alteryx Designer Desktop Discussions

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

Date format in Quarters

jerry239
8 - Asteroid

Hello Everyone

 

I am trying to create a new field in Alteryx where I have a Date field which contains data in the format of MM/DD/YYYY. I have 5 years of data and I am trying to build a Gantt view in Alteryx. My requirement is to show my date fields like below:

For example, my data contains date range from 2022 to 2027. So what I need from my date field is that if my year is previous or next year then all the dates should combine/converted into Quarter 4 data and must not be filtered out and if my data is in current year and I should see all of my quarters. Below is an example:

I have 2022 Q1, 2022 Q2, 2022 Q3, 2022 Q4, 2023 Q1, 2023 Q2, 2023 Q3, 2023 Q4, 2024 Q1, 2024 Q2, 2024 Q3, 2024 Q4, 2025 Q1, 2025 Q2, 2025 Q3, 2025 Q4, 2026 Q1, 2026 Q2, 2026 Q3 2027 Q4, 2027 Q1, 2027 Q2, 2027 Q3, 2027 Q4.

 

Desired Output: -

2022 Q4, 2023 Q4, 2024 Q1, 2024 Q2, 2024 Q3, 2024 Q4, 2025 Q4, 2026 Q4, 2027 Q4.

 

I tried various methods in Tableau as well as Alteryx but no luck so far. Below is my approach using Alteryx:

 

If YEAR( [Date])< 2024
then YEAREND([Date])
elseif YEAR( [Date])>
2024
then MONTHEND(YEARSTART([Date]))
else [Milestone Start Date] ENDif

 

Can someone please help me with optimizing my query?

11 REPLIES 11
jerry239
8 - Asteroid

@binuacs using this trick gave me Q1 and Q3 for every years from 2022 to 2027. :(

binuacs
20 - Arcturus

@jerry239 use the updated workflow

 

image.png

Labels