Free Trial

Alteryx Designer Desktop Discussions

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

I want to calculate difference in a dataset

Sshasnk
8 - Asteroid

I have a dataset where I finding very to difficult to calculate rows

Example:

 

Fundamountprior year amounttype
ABC123145Investment
ABC145156Total
LMN145615Investment
LMN15923Total
XYZ45656Investment
XYZ2314Total

 

In About all, I have to find a difference in investment and total (Type column)

Fundamountprior year amounttype
ABC123145Investment
ABC145156Total
ABC-22-11Difference
LMN145615Investment
LMN15923Total
LMN1297-8Difference
XYZ45656Investment
XYZ2314Total
XYZ43342Difference

 

I am not sure if it will be easy to transpose and do it or it should be done easily in row formula

9 REPLIES 9
ShankerV
17 - Castor

Hi @Sshasnk 

 

It can be easily achieved with the help of Summarize tool.

 

Then join the source and Summarize tool to get your output.

 

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @Sshasnk 

 

Here is the desired output for you.

 

ShankerV_0-1670324074623.png

 

My workflow:

ShankerV_1-1670324091542.png

 

 

Many thanks

Shanker V

 

DavidSkaife
14 - Magnetar

Hi @Sshasnk 

 

Here is a way of doing it:

 

DavidSkaife_0-1670323980937.png

 

Firstly calculate the differences using two Multi-Row Formula tools, then filter out unwanted fields. Rename the calculated fields and create the "Difference" type field, then union back together and finally sort in order.

 

ShankerV
17 - Castor

@Sshasnk 

 

My workflow explanation in detail, 

 

Step 1: Input the data

ShankerV_0-1670324230558.png

 

Step 2: Ignore my select tool, as I used to modify the datatype from Byte to Int

Use the Multi Field Formula.

 

ShankerV_1-1670324305529.png

 

Step 3: One more Multi Field formula

ShankerV_2-1670324336377.png

 

Step 4: Summarize tool

ShankerV_3-1670324365738.png

 

 

 

Sshasnk
8 - Asteroid

@ShankerV  Can you attach the workflow

ShankerV
17 - Castor

@Sshasnk 

 

Trying to attach, give me sec. Will fix the issue and attach the same.

 

Many thanks

Shanker V

ShankerV
17 - Castor

@Sshasnk 

 

Step 5: Formula tool

 

ShankerV_0-1670324728241.pngShankerV_1-1670324739937.png

 

Step 6: Union tool

ShankerV_2-1670324771619.png

 

Step 7: Sort tool

ShankerV_3-1670324793100.png

 

Output

ShankerV_4-1670324814280.png

Hope your issue is resolved. Feel free to mark helpful answers as a solution, so that future users with the same issue can find them easier!!!!

 

Many thanks

Shanker V

 

KrishnaChithrathil
11 - Bolide

@Sshasnk 

Here's another way we can think of doing.

 

KrishnaChithrathil_0-1670325580610.png

KrishnaChithrathil_1-1670325614969.png

 

ShankerV
17 - Castor

Hi @Sshasnk 

 

Took some time to fix the issue faced in saving the workflow. Here is my workflow attached for you.

 

ShankerV_0-1670327210148.png

 

Many thanks

Shanker V

Labels
Top Solution Authors