community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Pulling data from a query based on Custom parameters

I have a query database that is extremely large, and I want to know if it's possible to have a separate spreadsheet with categories and a specific number of those categories that will dictate what is pulled from the database. 

 

For example, I want to pull X amount of records from the school program COLGUDS, Z from COLRAD, and Y from COLDUS.

 

Highlighted
Asteroid

You could build a file with two fields - one for your "Select TOP 100", one for your "COLGUDS" - and use a Dynamic Input>Modify SQL Query>Replace a Specific String. You will need to do this twice to select each component of the query you want to replace

 

For instance ...

 

Example text input file ("|" denotes new cell)

SELECT TOP 100  |  COLGUDS

 

Example Query:

Select * from GenericTable

 

After Dynamic Input, query becomes:

SELECT TOP 100 From COLGUDS

 

Just lather, rinse, repeat for the other selections and tables. Queries may vary from what I listed depending on the database you are pulling from (Oracle, MySQL, NoSQL, etc)

 

Hope that helps!

Labels