This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have a table from SQL in-DB coming in and I want to create a new field with a formula. However in this formula, I am referencing another table and I do not know how to do that using in-DB alteryx tools. Here is an example of the SQL query I am trying to convert to Alteryx:
case when (Select code from TableA a where a.id = b.id) = "AAA") = 'A'
when (Select code from TableC c where c.id = b.id) = "CCC") = 'C'
from TableB b
This is a very simple example and might not make 100% sense, but the point is I'm not sure how to reference things from another table like TableA and TableC when writing a formula for a new field in TableB.
But the problem is, the Connect In-DB tool only allows me to connect to one table in the database (i think?). If I use this to connect to tableB and I want to add a new field (using Formula In-DB?) which references tableA and tableC from this database, I don't know how to do this since I believe the Alteryx workflow is only connected to tableB and has no info of tableA and tableC.
What do you mean the full location? Do you mean using the Connect in-DB tool to send in other tables rather than just one table? Because I am not sure how to do that or if that is possible, but it would make things easier.
Sorry, what I meant is making sure that the table name isn't referred to on it's own in the formula. So to have the database, schema and table name.
Like my example
You don't need to do anything with other Connect In-DB tools, you can just refer to it in the formula tool. It's just the case statement that goes in there though, you don't need the select, as that's handle by Alteryx for you.