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

Cross Tab Add percentage Column

BRRLL99
11 - Bolide

Hi

I have following dataset, I'm looking to percentage column to each column

 

in my original dataset

The no of rows in my data column are more than 1 million

and in name column more than 30+

 

dataNameValueTotalPercentage
AAA106016.67%
ASS206033.33%
ARR306050%
BAA209022.22%
BSS209022.22%
BRR509055.56%
CAA106016.67%
CSS406066.67%
CRR106016.67%

 

 

Expected Output:

 

 

dataAAAA - %RRRR - %SSSS - %TOTAL
A1016.67%2033.33%3050.00%60
B2022.22%2022.22%5055.56%90
C1016.67%4066.67%1016.67%60
9 REPLIES 9
ShankerV
17 - Castor

Hi @BRRLL99 

 

One way of doing this.

 

ShankerV_0-1681971663770.png

 

 

Many thanks

Shanker V

BRRLL99
11 - Bolide

Hi

I got my expected out-put 

1. is there anyway I can reduce no of usage of tools
2. Instead of Right_AA or Right_BB , column headers should be AA - %

BRRLL99_1-1681971597628.png

 

ShankerV
17 - Castor

Hi @BRRLL99 

 

Removed few tools to get the same output.

 

ShankerV_0-1681971881822.png

 

 

Many thanks

Shanker V

BRRLL99
11 - Bolide

please share the workflow

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

@BRRLL99 ,

Not sure if this works for 1MM rows, please let me know if it works.

Yoshiro_Fujimori_1-1681972349934.png

 

ShankerV
17 - Castor

Hi @BRRLL99 

 

Step 1: Input

 

ShankerV_0-1681972354229.png

 

 

Step 2: 

 

ShankerV_1-1681972371995.png

 

ShankerV_2-1681972381097.png

 

 

Step 3: 

 

ShankerV_3-1681972396274.png

ShankerV_4-1681972409249.png

 

 

Step 4:

 

ShankerV_5-1681972423476.png

ShankerV_6-1681972431680.png

 

 

Step 5:

 

ShankerV_7-1681972448214.png

 

ShankerV_8-1681972457072.png

 

 

Step 6:

 

ShankerV_9-1681972473863.png

ShankerV_10-1681972481346.png

 

Last step :

ShankerV_11-1681972519455.png

ShankerV_12-1681972534737.png

 

Many thanks

Shanker V

BRRLL99
11 - Bolide

@Yoshiro_Fujimori @ShankerV 

thq for Quick reply

 

I have column headers which are scrambled

I need to arrange accordingly in order

 

sample data: (column Headers)

 

AA | CC | ZZ | BB | AA% | CC%| ZZ%|BB%

 

Expected output

 

AA| AA% | BB | BB% | CC | CC% | ZZ | ZZ%

 

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

@BRRLL99 ,

The column order is automatically sorted on my original workflow.

That said, if it is a separate issue, here is one solution.

 

Input

Yoshiro_Fujimori_1-1681980433210.png

 

Workflow

Yoshiro_Fujimori_0-1681980418144.png

 

Output

Yoshiro_Fujimori_2-1681980462645.png

 

BTW, if you don't use "%" in the field name, you would not need to use Dynamic Rename tool, which would save your time.

 

ShankerV
17 - Castor

Hi @BRRLL99 

 

I recommend to use the sort field name macro which is already available.

 

http://www.chaosreignswithin.com/2014/09/blog-macro-pack-2014-q3-release.html

 

ShankerV_0-1681982219533.png

 

 

Many thanks

Shanker V

Labels
Top Solution Authors