Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Temporary Variable

bnadler004
7 - Meteor

Is there a way to create a variable inside a formula that is not related to a column?

10 REPLIES 10
bnadler004
7 - Meteor
I would like to do the following in a conditional statement:
If (Condition) then [New Variable] = [Column A] Else "Not Tested" (or -1 if
numeric) Endif

--
*Barry Nadler*
PwC | Specialist
Tampa | +1 (727) 483 4195
PricewaterhouseCoopers LLP
pwc.com

______________________________________________________________________
The content of this email is limited to the matters specifically addressed herein and is not intended to address other potential tax consequences or the potential application of tax penalties to this or any other matter.

______________________________________________________________________
The information transmitted, including any attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited, and all liability arising therefrom is disclaimed. If you received this in error, please contact the sender and delete the material from any computer. PricewaterhouseCoopers LLP is a Delaware limited liability partnership. This communication may come from PricewaterhouseCoopers LLP or one of its subsidiaries.
CharlieS
17 - Castor
17 - Castor

I'd like to help, but I think some more information is necessary. Could you describe what you are trying to achieve, or do you have a proposed formula?

CharlieS
17 - Castor
17 - Castor

@bnadler004 wrote:
I would like to do the following in a conditional statement:
If (Condition) then [New Variable] = [Column A] Else "Not Tested" (or -1 if
numeric) Endif

The conditional statement looks straightforward. What did you have in mind to create this "New Variable". Whatever you would do to create that variable could be done within the conditional statement rather that in a separate field.

 

 

 

 

bnadler004
7 - Meteor

I can get what I want using an Append, however, if there is the existence of temporary variables, it would be cleaner.

CharlieS
17 - Castor
17 - Castor

What information do you append? Could you attach an example of this workflow? 

 

Whatever goes into creating this "temporary variable" could probably be done within the conditional statement with the same formula without needing to define another variable.

 

bnadler004
7 - Meteor

The portion of this file  that is of interest ends with the formula tool, for now.  If, instead of the Append tool, I could use a formula tool, it would be cleaner.

CharlieS
17 - Castor
17 - Castor

Thanks for providing that sample workflow for me to review. It looks like you're trying to calculate the low/high value range for each vehicle type, for each record in your input. I wasn't sure what the A,B,C,D values in Dataset2 meant, so i skipped them for now.

 

Take a look at the attached example where I did a little clean up and preparation on DataSet2, then computed value ranges for each record in the second tool container. If this is all wrong, then let me know and I'll give it another shot. 

bnadler004
7 - Meteor

Charlie,

 

Unfortunately, I cannot open your solution.  We are still using V. 11.7

 

Thank you

CharlieS
17 - Castor
17 - Castor

Open the .yxmd file in Notepad and change the XML version to 11.5 and see if that works. 

 

XMLVersionEdit.png

 

 

 

Labels