Alteryx Designer Desktop Discussions

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

Question/Problem/Misunderstanding of workflow - Filter seems not to stop workflow

jeffv
8 - Asteroid

Hi,

 

I am attaching a work flow I'm having problems with.  As background, it is a workflow to check if a data source has the same fields as a given list of fields.  The part I'm wondering about is if the data source has no records then I don't get field names by transpose (not a huge deal but I wonder if there's a better way) I get a count which is essentially number of fields and then do a compare of the count of data source and field list.  If the count is > 0 then do the check using a crew macro however if it is equal to zero then it should stop.  However it processes on and I wonder how I should stop after I get on a certain path.   Anybody got ideas?  I'm using 11.7 of designer.

 

Jeff

7 REPLIES 7
BenMoss
ACE Emeritus
ACE Emeritus

The purpose of the 'expect equal' crew macro is to error when the row count of the two inputs is not equal, as it is in your case.

 

Here is how I would configure without the crew macro's, but perhaps @MarqueeCrew can offer better advice here.

 

Ben

Claje
14 - Magnetar

Hi,


The absolute easiest way to do this is an example I have attached.

 

This is not necessarily the most robust option, but it is an option that should work.

 

Basically, you can create a dummy column and populate one line of data, then perform a Union with your main dataset.  This will force at least 1 line of data to exist.  You can make sure this dummy column is deselected in the transpose tool, which should make the rest of the process work as expected.

 

EDIT: One more note - I think the Count records piece of this workflow is superfluous for the test you are trying to complete, and you could remove it as it is causing unnecessary errors in the Expect Equal tool

MarqueeCrew
20 - Arcturus
20 - Arcturus

In order to validate the format of two files, I would use a FIELD INFO tool after reading each file.  Then place a select after the Field info tool and only output the NAME & TYPE for each stream of data.  Then use the expect equals.  You'll find out if the two are configured the same.

 

Alternatively, if you add a UNION tool after each file you can set it to AUTO CONFIG BY  NAME and ERROR if fields are missing.  You'll see any issues quickly that way too.

 

Cheers,

 

Mark

 

PS, Ben give me a call sometime.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
jeffv
8 - Asteroid

I tried what you suggest in second paragraph with union, auto config by name and error first because it seemed simple and straight forward... workflow attached.  I must be missing something... though the field lists are different I don't see an error occurring... am I missing something?

Claje
14 - Magnetar

Hi,


I've attached a modified version of your workflow to show the idea that @MarqueeCrew was referencing here.

Basically, by having the file format on both sides, the Union tool will produce an error if there is a mismatch, as configured.

jeffv
8 - Asteroid

Thanks for the sample workflow...  At first I was confused at the workflow but I see it focused on the part of stopping when count = 0 and not the bigger picture of see when fields are different.  I will use your sample and incorporate it and see where I come out... thanks!

jeffv
8 - Asteroid

Claje,

 

Thanks for the insight....  you caused an "aha" moment where I came to understand things I hadn't before.   Going to play with this idea and see where it goes in incorporating in my workflow.

 

Thanks!

Labels