We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to give formula in multiple fields based for the values present in multiple fields

naveshkasulaspg
5 - Atom

I'm trying to give formula in multiple fields based on the values present in multiple fields. Below snippet is an example of what I'm trying to achieve. I want to give formulas in fields(highlighted)

 

Alteryx Designer_Discussion.jpg

 

 
 
6 REPLIES 6
TUSHAR050392
11 - Bolide

Hey @naveshkasulaspg You can use a formula tool and create the difference columns by mentioning the formula using column names.

E.g - Jan-23 Difference = Jan-23 Forecast - Jan-23 Actual.

 

Hope this is what you are looking for.

naveshkasulaspg
5 - Atom

Is there any other tool other than formula tool??

 

TUSHAR050392
11 - Bolide

If you want to create separate difference columns for each month using different columns then formula tool will be the easiest

apathetichell
20 - Arcturus

so let's assume you have like 100 columns or wahtever - and you want something fully dynamic...

 

you really want to use some kind of transpose logic here. basically transpose using fruit type as a key column. use a formula tool to create a match value for date (say left([Name],6). use a summarize tool grouped by your new field and your key column to sum your value field. use a crosstab tool with your original key field as key field. use your new field you used in your group by as the column name. use your sum field as your value. use a dynamic rename to rename your new column headers to include "total" (or whatever). join back to your original datasource on your original key field.

naveshkasulaspg
5 - Atom

Actually, I tried transpose then after formula as well but failed to give formula. Can you please give a try on the attached workflow. the output should be populating the data in the highlighted columns.

Alteryx Designer_Discussion.JPG

apathetichell
20 - Arcturus

@naveshkasulaspg you're being lazy. follow my instructions.

Labels
Top Solution Authors