Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Date Comparison

vijaylnyadav
8 - Asteroid

Hi,

 

I want to compare dates which is in a string format because the date time format is not fixed.

 

I am using simple >= logic but it is not working.

 

date1, date2, and date3 are the three columns but when they are equal it is validating but when they are not equal they are not validating.

 

Please suggest me some workflow.

 

Note: Date format is not fixed

11 REPLIES 11
Qiu
21 - Polaris
21 - Polaris

@vijaylnyadav 

Can you at least give us some sample data?

Emil_Kos
17 - Castor
17 - Castor

Hi @vijaylnyadav,

 

I would create a new column with the proper date format and keep the original one. 

The new one would be used for calculations but you can remove it along the way. 

vijaylnyadav
8 - Asteroid

Hi, @Qiu please find below the attached data.

 

Condition:

 

Date 1 <= Date 2 <= Date 3.

 

Date 1Date 2Date 3
29-May-1929-May-194-Jun-19
28-May-1928-May-1924-Jun-19
24-Apr-1524-Apr-151-May-15
29/8/1129-Sep-1710/30/17
27-Oct-1427-Oct-1410-Nov-14
17-Jun-1917-Jun-193-Jul-19
30-11-201730-Nov-1712/01/2017
17-Jun-1917-Jun-193-Jul-19
vijaylnyadav
8 - Asteroid

Hi, @Emil_Kos 

 

but how to create a new column if we dont know the date format from users.

Emil_Kos
17 - Castor
17 - Castor

Hi,

 

I have created a correct date format for each of the columns.

 

Emil_Kos_0-1611133344129.png

 

Next time I promise myself that I will go out from my comfort zone and use the formula tool as I have used tons of date-time tools.

 

Emil_Kos_1-1611133385166.png

 

vijaylnyadav
8 - Asteroid

Hi @Emil_Kos 

 

Please refer the following sample data.

because the previous i am getting null in the correct date columns.

 

This is the sample data receiving from user

Date 1Date 2Date 3
8-Oct-098-Oct-098-Oct-09
21-May-1921-May-1910-Jun-19
6-Dec-186-Dec-1821-Dec-18
29-May-1929-May-1918-Jun-19
2-Aug-172-Aug-1716-Aug-17
25-Feb-1525-Feb-1512-Mar-15
17-Jun-1917-Jun-1917-Jun-19
29-Jan-1829-Jan-1829-Jan-18
6/26/20186/26/20186/26/2018
5/19/20175/19/20175/19/2017
5/8/20175/8/20175/8/2017
5/9/20175/9/20175/9/2017
7/21/20177/21/20177/21/2017
7-Mar-087-Mar-087-Mar-08
1-Oct-031-Oct-031-Oct-03
7-Aug-077-Aug-077-Aug-07
13-Mar-1413-Mar-1420-Mar-14
27-Aug-1227-Aug-1212-Oct-15
27-Aug-1227-Aug-1227-Aug-12
11-Nov-0811-Nov-0824-Dec-19
Emil_Kos
17 - Castor
17 - Castor

Hi @vijaylnyadav,

 

Please find the updated workflow.

 

 

vijaylnyadav
8 - Asteroid

thankyou @Emil_Kos for this solution.

 

But what if the user uses another format other than.

 

Should i use every format instead?

Emil_Kos
17 - Castor
17 - Castor

Hi @vijaylnyadav,

 

you are not able to Force the user to use one format? The truth is there is always a risk of messing up a month with date. 


if that is possible I would force the user to fill this in one format or at least educate them about preferred format.

Labels