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

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

Date issue with, result are not correct

Dav
7 - Meteor
 

Hi,

Could someone assist me with an issue regarding dates. I have data from excel is formatted in general format. The dates appear as 03.01.2025 in Excel.

I have written a formula to change the Excel data into date format using DateTimeParse([Transaction_Date], "%d.%m.%Y"), and there are no issues with that, I hope.

 

However, I have another formula where I want to add a column that indicates if the date is equal to or greater than a certain date, it should show "Current". If the date is equal to or less than a different date, it should show "Old". If the data is not there, it should show "Unknown". The formula I used is below, but the results are not correct. All of my cells are showing "Old" even though some dates are after the specified date. Please see the formula below:

 

IF DateTimeParse([Transaction_Date], "%Y-%m-%d") > DateTimeParse("2025-09-30", "%Y-%m-%d") THEN "Current" ELSEIF DateTimeParse([Transaction_Date], "%Y-%m-%d") <= DateTimeParse("2025-09-30", "%Y-%m-%d") THEN "OLD" ELSE "Unknown" // Optional: Handle cases that don't fit either condition ENDIF

Thank you for your help!

 

 

 

 

19 REPLIES 19
Dav
7 - Meteor

I believe I have followed your advice, formula first, then select tool, then a created a simple formula to say if the date if past this date, then "Current" if not than "old"  but all my data come back as old

 

Screenshot 2025-02-14 165255.pngScreenshot 2025-02-14 165310.pngScreenshot 2025-02-14 165357.pngScreenshot 2025-02-14 165625.png

OTrieger
14 - Magnetar

fff.PNG

OTrieger
14 - Magnetar

Working fine for me

Dav
7 - Meteor

My issue is, when I ask the data to confirm if the data is prior or past the selected date, it bring back the incorrect answer. My last two pictures

 

OTrieger
14 - Magnetar

This part is wrongfdfd.PNG

OTrieger
14 - Magnetar

Try 
If [........] >= "2025-09-30" THEN .... ENDIF

OTrieger
14 - Magnetar

2025-09-30 is a static value, no need to parse it as it is in the correct format.

Dav
7 - Meteor

changed my formula but I still get the incorrect result. My column Rate current or old should be Current but it showing old, even tho the date is greater

 

Screenshot 2025-02-14 173101.pngScreenshot 2025-02-14 172833.png

 

 

OTrieger
14 - Magnetar

The date is not greater as all the values shows January, that is why you get Old. It compares September to January, same year 2025.

Dav
7 - Meteor

You are a life saver. Cant believe I had the date as 2025. Thank you so much

Labels
Top Solution Authors