Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Get previous quarter and year for filename

craigja
11 - Bolide

Im looking to save a file and in the filename I need the previous quarter and year.  So if I save the file in January 2021 I need to get Q4-2020 and if I save it in April 2021 I need Q1-2021.  Any ideas?

7 REPLIES 7
echuong1
Alteryx Alumni (Retired)

You can dynamically build the file name with a formula tool. I'm pulling today's date as the basis of the quarter. 

 

I'm dynamically changing the file name with the option at the bottom of the output tool.

 

echuong1_0-1617199661868.png

echuong1_1-1617199694499.png

 

 

craigja
11 - Bolide

Great idea - and I suppose if I need the previous quarter I just -1 from the month?

afv2688
16 - Nebula
16 - Nebula

Hello @craigja ,

 

Another way to solve it:

 

Untitled.png

 

Regards

shreyanshrathod
11 - Bolide

Hi @craigja ,

 

Let me know if this solution helps!!

 

I have created a customized Master which is very low maintenance and provides high flexibility.

 

Based on the month that you are running the workflow, I am then assigning the respective Quarter from our customized Master. Then, after concatenating the Current Year with the Quarter, you can use that to add as a Prefix / Suffix to your filename in the output Tool.

 

You can also Change the Entire filename.

 

Let me know in case of any query!!

 

Please mark this as solution if it satisfies your query.

 

Thanks,

Shreyansh Rathod

echuong1
Alteryx Alumni (Retired)

For the previous quarter, you can subtract 3 months, equaling 1 quarter.

 

echuong1_0-1617200182606.png

 

 

shreyanshrathod
11 - Bolide

Hi @echuong1 , @craigja

 

 Shouldn't the filename be Q4-2020 and not Q4-2021?

Sharing the updated solution here.

 

Please share your thoughts!!

Idyllic_Data_Geek
8 - Asteroid

@echuong1 I have a date 2023-06-30( 2nd quarter end date) and based on it I want to derive last (1st quarter end date). It shoild be 2023-03-31. The formula datetimeadd([Current_Quarter], -3, 'months') is giving me 2023-03-30 instead of 2023-03-31. Any suggestions on how I can solve for it?

Labels
Top Solution Authors