Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Updating a Query - Tell macro to skip an iteration if it errors?

Alayna
8 - Asteroid

Hi, I'm doing a little side project to map out all the tables, views, and columns in my company's database. I want to build an unofficial data catalog that also pulls the first row from each table, and then pivot it to show: Schema, Table, Column, Example Value, Data Type.

 

My macro runs fine but the issue is that I don't have access/permissions to every table in our database, so I want to find a way to tell alteryx to skip if the SQL gets the 'No Columns Returned' error. Or just skip a query if it gets any error and go to the next iteration. Is there a setting for this or a workaround? Since the data is confidential I can't really show you the values, but I hope the attached macro is helpful.

 

2 REPLIES 2
Felipe_Ribeir0
16 - Nebula

Hi @Alayna 

 

Cool macro!

 

Found a way to do this:

 

1) Use the IF EXISTS to verify if the table exists

     a)IF EXISTS, select *

     b)ELSE,create a table with dummy hardcoded data, column STATUS = IGNORE THIS ITERATION

 

Felipe_Ribeir0_0-1665703750597.png

 

2)Filter out if EXAMPLE VALUE = IGNORE THIS ITERATION

 

Felipe_Ribeir0_1-1665703964335.png

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

 

Alayna
8 - Asteroid

@Felipe_Ribeir0  This is perfect! Thanks for the idea!!!

Labels