Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

How to add error if the sheets imported using Macro do not have same fields

Data_Alter
8 - Asteroid

I have workflow where I import all the tabs of an excel using a Macro

 

But I want the workflow to let me know if all the fields in file are not same. So I am making the workflow output the table below.

 

I want the workflow to show an error because the field highlighted in red is not same as others.

 

First_F1First_F2First_F3First_F4First_F5First_F6First_F7First_F8First_F9
Cost CentreExpense CodePosting dateSourceReferenceNarrativeBalanceDaybook dateTRQ
Cost CentreExpense CodePosting dateSourceReferenceNarrativeBalanceDaybook dateDaybook number 1 
Cost CentreExpense CodePosting dateSourceReferenceNarrativeBalanceDaybook dateDaybook number 1 
1 REPLY 1
DataNath
17 - Castor

@Data_Alter would something like this work if you were to implement it after the macro output? This approach:

1 - Transposes the data, bringing all field names + values into rows

2 - Groups by field name and performs a distinct count of all values within that group

3 - As we're looking for differences, we ought to be concerned when that count distinct is higher than 1 and so we use a message tool here to trigger on that condition being met

 

Workflow runs fine as all fields have identical values:

DataNath_0-1661445224137.png

DataNath_4-1661445319983.png

 

Error message is triggered, due to the 'TRQ' difference:

 

DataNath_2-1661445253683.png

DataNath_3-1661445296809.png

Labels