Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Alteryx Formula

SouravKayal
8 - Asteroid

Hi Guys,

 

SO i have a requirement which is like i need to make a calculated field like a YTD$ column which is a sum of columns like Jan $, Feb $ etc which is in my data. The requirement is not to change the formula every month but like an external excel input which will have the data of which columns to add for YTD or Full year. Something like an excel file which has a column exact YTD $ and the values are Jan $. So we only take Jan $ for the final formula. Is that possible ?

9 REPLIES 9
Miglani
7 - Meteor

Hi Sourav,

Based on my understanding on your problem. You have an excel file(let's call it Months_file) which can have dynamic months (Jan, Feb, March .. etc) and you need to make ONLY one formula which will cater whatever months are present in this Months_file.

If my understanding is correct, you can input this file and transpose all columns and then summarize the values.
To understand better what I'm talking about I've made a sample workflow for the same.
NOTE: I tried to add another month in excel file and the same workflow worked, incorporating the additional month added.

Let me know if this solves your problem. 🙂

AkimasaKajitani
17 - Castor
17 - Castor

Hi @SouravKayal 

 

You can use Transpose tool and Cross tab or Summarize tool.

 

Sample Input :

AkimasaKajitani_0-1610099528945.png

AkimasaKajitani_7-1610100312397.png

 

The first step is to use the transpose tool to make the data vertical.

At this tool, If the data of the March is added, "Dynamic or Unknown Columns" option will dynamically solve.

AkimasaKajitani_1-1610099694935.png

 

To add the column of total, you can use CrossTab tool.

 

AkimasaKajitani_2-1610099947725.png

AkimasaKajitani_3-1610099960495.png

Output Sample:

AkimasaKajitani_5-1610100013629.png

 

 

 

Or add the row of total, you can use Summarize tool.

AkimasaKajitani_4-1610099997954.png

 

Output Sample:

AkimasaKajitani_6-1610100043648.png

 

 

SouravKayal
8 - Asteroid

So the problem is my main data cosnists of Jan column and the values to it. This external file will only have the months. Now my formula will use the months (column headers) from this file and the values from the main data set.

SouravKayal
8 - Asteroid
YTD $ROI
Jan $Mar $
Feb$April $
 May $

 

So this can be my input file. Now the Jan $, Feb $ columns are also in my data set that is being transformed. What I was looking is if i could use the above input and keep the same formula all the time. For example my YTD formula will be a sum of the columns that is mentioned in the above input file and FY will be a sum of both the columns mentioned above. So the formula remains static in the workflow but the excel input can change every month.

AkimasaKajitani
17 - Castor
17 - Castor

Hi @SouravKayal 

 

Is this helpful?

 

Input : 

AkimasaKajitani_0-1610101642069.png

 

WF : 

AkimasaKajitani_1-1610101661197.png

 

 

AkimasaKajitani_2-1610101704882.png

 

AkimasaKajitani_3-1610101732353.png

 

SouravKayal
8 - Asteroid

as i said i wont have the $ value in the excel just the month names

AkimasaKajitani
17 - Castor
17 - Castor

Do you indicate that you have a table with column names and another table with only data?

 

Column Table

AkimasaKajitani_0-1610103086756.png

 

Data Table?

AkimasaKajitani_1-1610103115455.png

 

If you have sample data format, would you please show it to response accurately?

SouravKayal
8 - Asteroid

Correct

AkimasaKajitani
17 - Castor
17 - Castor

Is this helpful?

 

AkimasaKajitani_0-1610103541725.png

 

Labels
Top Solution Authors