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

Pulling data from a query based on Custom parameters

AlexStewart628
7 - Meteor

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.

 

1 REPLY 1
ADerbak
11 - Bolide

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