The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Date format in Quarters

jerry239
Asteroide

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 RESPOSTAS 11
jerry239
Asteroide

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

binu_acs
Polaris

@jerry239 use the updated workflow

 

image.png

Rótulos
Autores com maior número de soluções