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.
SOLVED

Creating a new column to get total

Dheeru28
8 - Asteroid

Hi

I have the following data:

 

 Total WeekMonTueWedThuFri
A 531212
B 241047
B/A 0.41.3333330.83333343.5
(A+B) 772259
C 29380
C/B 12.250.320
C/(A+B) 0.2857141.2857140.1363641.60

 

What I need is the output for the total week column. While we can use formula for adding rows A, B and C for Mon-Fri, that won't give correct output for B/A, (A+B), etc.

 

Can someone please suggest a way to solve this?

 

Thanks a lot!! 

7 REPLIES 7
Christina_H
14 - Magnetar

You need to complete the other calculations after summing A, B and C, something like this

Christina_H_0-1684837621132.png

 

Dheeru28
8 - Asteroid

Thank you very much @Christina_H 

The RegEx match formula you have used in the filter tool gives 0 records on my data. It's likely because in my data, "\w+" is not working.

 

The rows that need to be filtered out (in my data) have "%' in them. How do we remove them?

 

Christina_H
14 - Magnetar

Much simpler if they all contain %.

 

!Contains([Calc],"%")

 

You might also need to correct the names before joining back to the original data - crosstab replaces spaces and punctuation with _

Dheeru28
8 - Asteroid

Thanks a lot, it worked.

Dheeru28
8 - Asteroid

@Christina_H

A follow up question: If I also want to do the same calculations for, say, Mon+Tue and Thu+Fri in new columns, will I need to repeat this process for each of the new columns or is there a way to do them all together?

Christina_H
14 - Magnetar

You can do it all at once with some small changes to the process, see attached.  If you also needed e.g. Wed+Thu you'd need to add a step to duplicate columns in multiple groups.

Christina_H_0-1685005545910.png

 

Dheeru28
8 - Asteroid

Thank you so much! This will make my workflow a lot less crowded.

Labels