In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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