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

New current_year column based on the Year column containing multiple years

deepnandi
6 - Meteoroid

Hi All, 

 I need help to extract current year from [Year] column which has multiple years to create a new current year column. Please the see the screenshot input column and output column.

 

 

Thanks in advance

7 REPLIES 7
Qiu
21 - Polaris
21 - Polaris

@deepnandi 
How about using DateTimeformat(DateTimeNow(),"%Y")

ShankerV
17 - Castor

Hi @deepnandi 

 

Please use formula tool..

 

Screenshot 2024-10-03 111752.png

Many thanks

Shanker V

deepnandi
6 - Meteoroid

Thanks @ShankerV , I need to extract the current year which 2024 from the input column to create the new column. Hope this helps

ShankerV
17 - Castor

Hi @deepnandi 

 

Can you please share the same date in the input column.

Need to check the date format.

 

Many thanks

Shanker V

deepnandi
6 - Meteoroid

Its not a date I have only years. the format of column is string.

ShankerV
17 - Castor

Hi @deepnandi 

 

Please share the string, the input sample which you have attached doesnot gives full information to help.

 

Your input:

Output (1).jpg

Many thanks

Shanker V

CoG
14 - Magnetar

If you need to overwrite the [Year] field then you can use the Formula Tool and @Qiu 's formula:

DateTimeformat(DateTimeNow(),"%Y")

 

Otherwise, you will need to be more specific as to your specific needs as @ShankerV has mentioned. You know what you need, but we do not. Be as simple and thorough as you can, include the exact structure of the input and then the sample output, which looks exactly how you need it to, and do this with two separate tables (not one that's merged together). This will help communicate your precise needs to the community.

Labels
Top Solution Authors