Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Notify when file's dates are consistent

anhdo92
8 - Asteroid

Hi All,

I have the following two excel files to reconcile 

 

File 1 :

File’s name System A 20210913 where 20210913 is date formatted as YYYYMMDD

 

 

File 2:
File’s name is System B 13092021 where 13092021 is date formatted as DDMMYYYY


I would like to set up a scheduler for my workflow to run automatically following the rules below:

  • If dates from the two files are the same (13 Sep 2021 in this example), the workflow runs as normal. It will send out the reconciliation result via email to relevant recipients
  • If the dates from two files are different, the workflow will stop running and will send an email to notify recipients of the inconsistent dates

 

Any idea is much appreciated! 

Thanks

13 REPLIES 13
mst3k
11 - Bolide

Use DateTime tools from Parse tool to turn them into consistent date formats

Use a Test tool from the Developer menu to test if the dates are equal, and throw an error if they are not equal. Click the background canvas of your workflow, and in the configuration on the Runtime tab choose "Cancel Running Workflow on Error" - the Test tool will generate an error and that will kill the workflow if the dates are not equal. Then in the Events tab, add a Send Email event when the workflow generates an error

atcodedog05
22 - Nova
22 - Nova

Hi @anhdo92 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1631518327982.png

1. In input tool extarct filename.

2. Using formula extract date.

3. In Join tool join on date. If Date is same then go to success block and its not then got to failure block.

 

Hope this helps : )

 

anhdo92
8 - Asteroid

Thanks you two,

@atcodedog05  there is no record coming through the Failure path and hence the workflow cannot continue to run and create text to be sent via email. Could you please advise ?

atcodedog05
22 - Nova
22 - Nova

Hi @anhdo92 

 

That is the required logic. Let say if the date is not same then failure block will have rows which you can use to send the email.

 

If they are the same failure block will not generate output.

anhdo92
8 - Asteroid

@atcodedog05 I also notice the Join tool doesn't work as expected as it triggers the workflow to run even when dates are not consistent.

What I want to do is
- If dates are the same, workflow continues to run as usual
- If dates are not consistent, the whole workflow will stop and will create an email to notify users

anhdo92
8 - Asteroid

@atcodedog05 
Thank you for the reply. Yes following the failure path, I add the report and email tool to create notification email but no email got sent...

anhdo92_0-1631521744536.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @anhdo92 

 

Here is how you can do it. With help of message tool.

Workflow:

atcodedog05_0-1631522015129.png

 

Make sure you configure event to send email on after run with errors.

atcodedog05_1-1631522071727.png

 

Hope this helps : )

Hope this helps : )

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @anhdo92 

 

Did you make sure dates were not the same for the above scenario which you tried.

anhdo92
8 - Asteroid

Thanks a lot @atcodedog05 !!!

 

Another thing I've just come across is the date format. Below is my actual file name

 

anhdo92_0-1631522595482.png

I just wanted to extract the date but looks like the formula doesn't work ...

anhdo92_2-1631522671229.png

 

It creates null value instead of dates...

anhdo92_1-1631522643238.png

 

 

Labels