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

Converting a Workflow to SQL

ChrisT
5 - Atom

Alteryx has been a great tool for someone who doesn't have a lot of SQL practice.  I can use a simple query to get the raw data then start to transform it.

 

However, not all of my projects at work have room for an Alteryx step in them. I'm looking to convert or see the script my workflow is running to something resembling SQL.  This would be a huge help when trying to write the SQL I'll eventually have to use on certain projects.

 

I understand it wouldn't be 1:1. I couldn't just plug & play but it would be a great resource.

 

Is there a way to export or view the underlying procedures a Workflow is running?

15 REPLIES 15
MattD
Alteryx Alumni (Retired)

Hey ChrisT!

 

The easiest way would be to use In-Database (DB) tools to build your workflow (if you have a supported database) and to output the SQL query those tools generate.

 

Similarly to how you can Data Stream Out your records resulting from your In-DB operations, you can use the Dynamic Output In-DB Tool to output things like your connection name, data source, xml, and the SQL query that your In-DB operations would generate (up until that point in the workflow):

 

In-DB.jpg

 

In this example I simply counted the unique Manager IDs from the table with the Summarize In-DB tool – you can see the SQL query does the same.

 

If you could set up a testing/temporary database connection to any one of those supported databases, you could emulate any one of your workflows using the In-DB tools and export the query that way.

 

Best of luck!

Matt D

Former Alteryx, Inc. Support Engineer, Community Data Architect, Data Scientist then Data Engineer
nthgol
5 - Atom

Hi Matt - a quick follow up:


For those looking to convert their flow to in-DB to use this functionality, is there a resource that shows you how to replicate some of the unavailable tools (eg Tile, etc) into in-DB formulas?


Thanks

Maria2
6 - Meteoroid

 Hi @MattD, with this solution I can see my workflow in sql?

DanM
Alteryx Community Team
Alteryx Community Team

@Maria2,

 

You won't be able to "see" your workflow in SQL. The In-DB tools create a query that gets executed once all of the In-DB tools are configured and ran. In this particular post the user is wanting to use Alteryx to build the query and then use the query to execute against SQL. The Dynamic Output tool will give you that query. The In-DB tools create a temp table within your database upon execution to run the query and depending on how you have chosen to output the data the tools will then add your query to where ever you have chosen, then the temp table gets removed.

 

Here is some further information on the In-DB tools https://help.alteryx.com/current/In-DatabaseOverview.htm

 

DanM

Maria2
6 - Meteoroid

ok and some solution, where I can see my workflow in sql or visual studio?

DanM
Alteryx Community Team
Alteryx Community Team

@Maria2,

 

I am not sure what you are asking as you cannot see workflows in SQL or visual studios. Can you please give more details to what you are attempting to do?

 

Thanks

DanM

Maria2
6 - Meteoroid

Of course, I want to migrate my ETL Alteryx to Visual Studio. 

DanM
Alteryx Community Team
Alteryx Community Team

@Maria2,

 

If your entire workflow is using In-DB tools, then you can get the query from the tools to use in SQL. I am not sure about Visual Studio, you would have to attempt. If you are using any tools other than In-DB tools, you will not be able to add that process into SQL.

 

DanM

Maria2
6 - Meteoroid

Can I generate in .net a dll to visualize my etl running in the visual studio?

Labels