Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music
SOLVED

Parameterize SQL table names

Highlighted
5 - Atom

Hello!  I have a common process that I run on multiple tables within a database and want to build an analytics app that would allow my users to change the table name as needed.

 

I have built a process that uses actions with an update string, but the process won't run because Alteryx is trying to validate my query and it is pointing to a table that doesn't exist.

 

My query looks something like:

Select * from 'parameter1'_'parameter2'_data 

 

Writing this, I realize that I could point it to a table that does exist and overwrite the strings for that table, but if that table would ever get dropped my process would stop working and I would like to avoid that if possible.

 

Thoughts?

 

Update:  Pointing to a table that already exists doesn't work since it is not technically a string the replace doesn't replace and making the parameters strings causes the same failure.

Highlighted
5 - Atom

Update #2: Was able to get the string replace to work by replacing the entire table name.  I had to create the full table name in a formula and use that as an input into my workflow.

Highlighted
5 - Atom

I was able to solve this using a dynamic input tool being fed by a text input tool that has actions.

 

For development, I can test my workflow by updating the values in the text input tool and keeping my parameters in the workflow don't have to worry about going back and updating them.

 

Example workflow attached.

Highlighted
5 - Atom

I don't see any sample workbook. Can you please attach the workbook?

Labels