Alteryx Designer Desktop Discussions

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

How to add same Alias for multiple input from MS SQL server

allendom
5 - Atom

Hello, I am trying to retrieve data from multiple tables (around 30 tables) in MS SQL server and check for different dates. Those tables have the same alias (timestamp) like _20230612 is same for every single table.

 

For example, the input tables (30) are like below and will be union together for checking.

Staging_A_20230612

Staging_B_20230612

Staging_C_20230612

Staging_D_20230612

 

Since I need to update the table alias (_20230612) for each checking and I have tons of table to update, is anyone knowing how to update the timestamp once and have all my 30 table names updated So I don't have to update all the table names manually each time. Thank you so much!

 

for example I input 20230611 then all my input get updated to:

Staging_A_20230611

Staging_B_20230611

Staging_C_20230611

Stagng_D_20230611

3 REPLIES 3
nagakavyasri
12 - Quasar

This might help

 

Screenshot 2023-06-12 140045.png

apathetichell
18 - Pollux

Here's what I would do:

 

outer workflow:

1) Follow @SeanAdams 's advice on grabbing MS SQL tables here:

https://community.alteryx.com/t5/Alteryx-Server-Discussions/Tool-or-workflow-if-an-input-redshift-ta...

2) filter for your tablenames that you want.

 

macro:

3) create a macro with a text input containing a base query and your connection name.

4) attach the macro to your dynamic input in-DB tool.

5) use a formula tool to adjust your timestamp logic.

6) use a write in-db tool to write back to MS SQL.

7) turn your macro into a batch macro and use a control parameter/action tool combo to update your base table in your query in your text input tool.

 

outer workflow:

8) in your outer workflow - bring your macro onto your canvas.

9) connect your table names to your control parameter.

jdminton
12 - Quasar

I might be over simplifying your request, but is this what you're looking for?

jdminton_0-1686606166181.pngjdminton_1-1686606172376.png

 

Labels