We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Convert a string with multiple date format to the same format in Multi-Row formula

fusheng_wang1
5 - Atom

Hi

 

Context:

I'm already inside the Multi-Row formula tool, have check if row ends with "a" has the same date with row that ends with "c" regardless of date formatting.

 

Input data(and expected outcome):

TypeInputExpected output
1a2022-12-28,2023-03-28 
1b FALSE
1c28-12-2022 
2a2023-01-04.2023-01-04 
2b TRUE
2c4/01/2023, 04-01-2023 
3a2017-12-27,2018-03-26,2018-06-25,2018-09-25,2018-12-27 
3b FALSE
3c2022-03-25,2022-06-27,2022-09-26,2022-12-28 
4a04-01-2023 
4b TRUE
4c4/1/2023 

 

Attempted code (which doesn't work):

if EndsWith([Type],"b")

AND

Join(
    Map(
        RegEx_Replace([Row-1:Input], '[ ,]+', '|'),
        DateTimeFormat(
            DateTimeParse(Replace([Row-1:Input], '|', ','), 'M/d/yyyy|M/d/yy|yyyy-MM-dd|yy-MM-dd|MM/dd/yyyy|MM/dd/yy'),
            'yyyy-MM-dd'
        )
    ),
    ','
)

=

Join(
    Map(
        RegEx_Replace([Row+1:Input], '[ ,]+', '|'),
        DateTimeFormat(
            DateTimeParse(Replace([Row+1:Input], '|', ','), 'M/d/yyyy|M/d/yy|yyyy-MM-dd|yy-MM-dd|MM/dd/yyyy|MM/dd/yy'),
            'yyyy-MM-dd'
        )
    ),
    ','
)

then "TRUE"

else "FALSE"

endif

 

What I think the problem is:

Can't find Join and Map function... not sure what else can be used.

 

 

1 REPLY 1
PhilipMannering
16 - Nebula
16 - Nebula

Hey @fusheng_wang1 

 

Maybe try something like this? Let me know if itt works!

PhilipMannering_0-1681132342165.png

 

Labels
Top Solution Authors