Alteryx Designer Desktop Discussions

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

How to sql subquery into Alteryx workflow

saraswathireddy
7 - Meteor

Hi Team,

 when we execute this sql code we get the result that we should do in alteryx ,by using tools we should prepare the workflow to create below subquery,

###code:

SELECT
HZ_RELATIONSHIPS.OBJECT_ID||'~'||HZ_CUST_ACCOUNT_ROLES.CUST_ACCOUNT_ROLE_ID||'~'||1 CUSTOMER_CONTACT_KEY
,HZ_CUST_ACCOUNTS.CUST_ACCOUNT_ID
,HZ_RELATIONSHIPS.OBJECT_ID CONTACT_PARTY_ID
,HZ_CUST_ACCOUNT_ROLES.CREATED_BY CREATED_BY
,HZ_CUST_ACCOUNT_ROLES.CREATION_DATE CREATION_DATE
,HZ_CUST_ACCOUNT_ROLES.CUST_ACCOUNT_ROLE_ID CUST_ACCOUNT_ROLE_ID
,HZ_CUST_ACCOUNT_ROLES.LAST_UPDATED_BY LAST_UPDATED_BY
,HZ_CUST_ACCOUNT_ROLES.LAST_UPDATE_DATE LAST_UPDATE_DATE
,HZ_RELATIONSHIPS.PARTY_ID PARTY_ID
,HZ_RELATIONSHIPS.RELATIONSHIP_ID RELATIONSHIP_ID
FROM HZ_CUST_ACCOUNT_ROLES,
HZ_RELATIONSHIPS,HZ_CUST_ACCOUNTS
WHERE 1=1
AND HZ_RELATIONSHIPS.SUBJECT_ID=HZ_CUST_ACCOUNTS.PARTY_ID
AND HZ_RELATIONSHIPS.PARTY_ID=HZ_CUST_ACCOUNT_ROLES.PARTY_ID
AND HZ_CUST_ACCOUNTS.CUST_ACCOUNT_ID=HZ_CUST_ACCOUNT_ROLES.CUST_ACCOUNT_ID

4 REPLIES 4
geraldo
13 - Pulsar

@saraswathireddy 

 

A question!
if putting all this sql code inside an inout or indb input tool does not meet your need.
or do you really want to make separate consulates due to the database being different and break each query into a tool and do the join?

saraswathireddy
7 - Meteor

@geraldo 

 

Thank you for Reply

 

yes,want to make separate consulates due to the database being different and break each query into a tool .

 

 

 

 

jdminton
12 - Quasar

 See below if this helps. The non-highlighted portions will be fields in the select tool after the input and joins. Ignore the "where" as it isn't necessary.

Snag_124d5d20.png

jdminton
12 - Quasar

@saraswathireddy  I can't tell from your image since we don't see what's happening in the tools. Is your output not getting what you need?

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels