Alteryx Designer Desktop Discussions

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

SQL formulas convert with in the Alteryx

stevelogue1980
8 - Asteroid

Hi Geeks,

I' ve these SQL formulas and looking to find best tools as well logic inside to convert with in the Alteryx Workflow.

 

nvl(TBL2_PROD_LN_DESC,TBL2_PROD_LN_DESC) AS ROD_DESC

 

and also this one

SUM(DECODE(TYPE,'Grocery',TYPE2,0)) QTY 

1 REPLY 1
DataNath
17 - Castor
17 - Castor

Hey @stevelogue1980, for the first formula we can use the ISNULL() function within an if statement. If this is satisfied we return TBL2_PROD_LN_DESC2 (I've guessed there was supposed to be a 2 here otherwise the formula wouldn't make sense), otherwise we just return TBL2_PROD_LN_DESC:

 

DataNath_0-1674080129560.png

 

For formula 2, that's just another if statement which is all DECODE() is - if TYPE = Grocery then give us TYPE2, else 0. After that, we just use the Summarize tool to aggregate - SUM() this:

 

DataNath_1-1674080201498.png

DataNath_2-1674080210165.png

 

Hope this helps! Please do shout up if you have any questions. Workflow also attached.

Labels
Top Solution Authors