Alteryx Designer Desktop Discussions

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

Create Variables Similar to SQL Local variables

tjamal1
8 - Asteroid

Can we create a variable in Alteryx like an SQL local variable that can be created using set statement ?

For example

Set @last_end_dt = isnull((Select Max(end_dt) From Customer), '2016-03-31')

 

and this variable has usage in another formula

set @end_year = (select fiscalyear from dimDate where FullDateAlternateKey = DATEADD(DAY,28,@last_end_dt))

 

I want to create these variables so that i can use them in any part of the workflow 

 

Is there any way to do it ?

 

 

3 REPLIES 3
danilang
19 - Altair
19 - Altair

Hi @tjamal1 

 

There is no equivalent of dynamic local variables in Alteryx.  The closest thing is user constants, but they are static once set and cannot be changed in the workflow.

 

The way this is usually handled in Alteryx is to use a tool to create a new column of data in your work flow using a formula tool if you can calculate the value inline or perhaps a summary tool followed by an append fields to create summarized values.

 

Dan

 

     

tjamal1
8 - Asteroid

So that means if i want compare that specific value to the column of another table , I Should append this specific field to that table ? 

 

 

danilang
19 - Altair
19 - Altair

Hi @tjamal1 

 

That is correct.  Either append the field or use a join tool if appropriate.

 

Dan

Labels