Inputting Alteryx outputs into a Query
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have my Alteryx workflow finished, and I want to put the output data into a query. Please let me know if Alteryx can do this automatically. Here is an example of what I would want...
Alteryx Output:
Store | Apples | Oranges | Peaches |
Walmart | 4 | 3 | 2 |
ShopRite | 9 | 5 | 8 |
Then, I would only want to put the Apples and Oranges data into my query, with each entry looking like this:
Select discussion example
In Apples('4', '9')
and
In Oranges('3','5')
So essentially, I want to get the data into the query following the format 'text,' for each input, and only use data from the apples and oranges row.
I hope I explained this well lol, any help is appreciated.
Solved! Go to Solution.
- Labels:
- App Builder
- Apps
- Best Practices
- Common Use Cases
- Connectors
- Custom Tools
- Data Investigation
- Database Connection
- Datasets
- Demographic Analysis
- Developer
- Developer Tools
- Download
- Dynamic Processing
- Engine
- Gallery
- Help
- In Database
- Input
- Interface Tools
- Iterative Macro
- Join
- Machine Learning
- Macros
- Optimization
- Predictive Analysis
- Preparation
- Prescriptive Analytics
- Python
- R Tool
- Reporting
- Run Command
- Scheduler
- Settings
- Tips and Tricks
- Transformation
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You just want a line of text in that format? Why only Apples and Oranges columns? Are they selected by you?
Is this format what your looking for?
In [Column 1]('[Row 1]','[Row 2]','[Row 3]',...)
and
In [Column 2]('[Row 1]','[Row 2]','[Row 3]',...)
and
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for the reply,
Yes, those columns are selected by me. They would be the only ones in my scope. And yes, in that format.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
MULTI-FIELD FORMULA - convert all of your columns to text using tostring([_CurrentField_]).
next.
split your datastream
SUMMARIZE 1:
settings concatenate apples
(' ',' ') are your settings
SUMMARIZE 2
settings concatenate oranges
(' ',' ') are your settings
FORMULA tool
add "IN "+your concatenated output
UNION
combine both of your data streams in UNION - I don't care about the order.
SUMMARIZE
concatenate both entries coming out of UNION - use AND as your seperator.
FORMULA tool:
add "Select discussion example " to your concatenated value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
is there a way to run the query at the end?
in the example, it is just two "in" statements, but could i run the entire query that those "in" statements sit in? As in, get those into the query and then run it?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
is there a way to run the query at the end?
in the example, it is just two "in" statements, but could i run the entire query that those "in" statements sit in? As in, get those into the query and then run it?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@mfranchino21 depending on how the rest of your workflow is set up, you can do the following:
- Connect the Summarize tool to a Drop-Down tool.
- Connect the Drop-Down's Q anchor to the lightening bolt anchor of the Input tool that contains your SQL query. This will create an Action tool separating your Drop-Down and Input tools.
- In your Action tool, select 'Update Value (Default), and 'Input Data>File (this should be your full SQL query's syntax).
- In your Action tool, you can select "Replace a specific string', and find the IN statement you are needing to substitute (see below). Connect a Browse tool to the end see all of the results. Since you are using an Interface tool, your workflow will now become an Analytic App.
