community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Temporary Variable

Highlighted
Meteoroid

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

Meteoroid
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.
Alteryx Certified Partner

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?

Alteryx Certified Partner

@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.

 

 

 

 

Meteoroid

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

Alteryx Certified Partner

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.

 

Meteoroid

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.

Alteryx Certified Partner

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. 

Meteoroid

Charlie,

 

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

 

Thank you

Alteryx Certified Partner

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

 

XMLVersionEdit.png

 

 

 

Labels