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

Alteryx Designer Desktop Discussions

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

sum all the number and put it in the last second line in the dataset

Sshasnk
8 - Asteroid

I have a dataset and I have to sum few fields and put it the row which has total.

 

Input: 

namelast nameamount last year amountdebt
Luffymonkey1,23,00010200
Ageontargaryen120020,000150
LeoMessi15,000100150
Total 139200  

 

Output:

namelast nameamount last year amountdebt
Luffymonkey1,23,00010200
Ageontargaryen120020,000150
LeoMessi15,000100150
Total 13920020200500
5 REPLIES 5
grazitti_sapna
17 - Castor

Hi @Sshasnk , Please find the workflow below for taking the subtotal  across columns:

 

grazitti_sapna_0-1667215222461.png

 

Sapna Gupta
DataNath
17 - Castor
17 - Castor

Here's one way I'd go about this @Sshasnk, leveraging the built in 'Total Row' functionality of the Cross-Tab tool:

 

DataNath_0-1667215189245.png

 

1) Some of your incoming 'numbers' are currently strings and so the Multi-Field Formula tool addresses this, stripping out commas and changing the data type to numeric.

2) We Transpose the data, bringing the numeric titles into the actual dataset itself, alongside the corresponding values.

3) We immediately re Cross-Tab the data, selecting the built in functionality to generate a total row:

 

DataNath_1-1667215297062.png

 

4) We conduct a little bit of clean-up with the Dynamic Rename tool to remove artefacts of the Cross-Tab

5) As we group on 2 fields in the Cross-Tab, we get 'Total' appearing in both and I've therefore just removed this with a standard Formula expression

 

Hope this helps - any questions or if this isn't quite what you were looking for then please do let us know!

binuacs
21 - Polaris

@Sshasnk One way of doing this

 

binuacs_0-1667215653674.png

 

Sshasnk
8 - Asteroid

@grazitti_sapna I made one change where I just want to calculate 2 columns only, So basically I have to pick columns which does not have total values in it

binuacs
21 - Polaris

@Sshasnk if you have already a total one column just filter out that and use the transpose and cross tab tool to find the total of all rows

 

binuacs_0-1667216405463.png

 

Labels