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

How to create variance column after analytic app selects two columns with List Box

ELPC
8 - Asteroid

Hi all, 

I'm kind of stuck in my workflow.  If I have 12 months of data in columns and then put in a List Box tool to create an Analytic app against a Select tool so that the user can select two columns for comparison, how do I then create a variance column based upon the two columns?  As the 2 columns will change based upon the user setting, I don't think a formula tool would work. Thanks! 

 

Original Data                                                                                                                 Data after analytic app - two columns will show.  I want a to create a variance column.                                                                          

Sample Data.png   ----->  Sample Data 1.png

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @ELPC 

 

See Analytic app as an example below:

 

deparaanalyticapp.PNG

 

The trick here is to use the Dynamic Rename in combination with a simple Text Input Tool.

You generate fake names to be used in the Formula Tool, and then you could rename your fields back using another Dynamic Rename tool.

 

App attached. Please let me know if this solves your problem.

 

Cheers,

ELPC
8 - Asteroid

Thank you so much for the quick reply but I have version 2018.4 so I can't download your workflow.  I thought about doing what you were suggesting by replacing the column headers but I wouldn't know what to change the columns to as it will be ever changing.  

 

If I tried to change the "P4" column to "Column A" and the "P3" column to "Column B" so that I can use the formula Column A - Column B, it will then not work out the following month.  The following month it will be "P5" column should be "Column A" and "P4" should now be "Column B".  

 

Or if I was using the actual months to make more sense.  One month I would want Apr vs Mar, but the following month I would want May vs Apr.  

 

First month = use formula Column A - Column B 

Apr = Column A

Mar = Column B 

 

Second month 

May - Column A 

Apr = Column B 

Thableaus
17 - Castor
17 - Castor

Try this on version 2018.4

 

I put a ABS in the formula Tool to get the absolute difference between the two field, since you mentioned variance.

 

Check the second Dynamic Rename as it automatically renames back to the right order.

 

Cheers, 

ELPC
8 - Asteroid

Ah!  I still couldn't download your workflow but I think I got the idea.  Didn't know I could do that with the Dynamic Rename.  Learned something new!  Thank you so much!  

Labels