Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Table Formula with changing number of Fields.

Johnnyt3883
5 - Atom

Hi I am new to Alteryx and would like to understand its capabilities,

 

I have the following table,

NameField 2Field 3Field 4Field 5Field X
A181223

B

3111487
C7171013
D1013348
Y247135

Where the number of fields changes often depending on dataset I am looking at and is very large.

Number of Rows Y is also very large and changing between targeted datasets,

 

 

Is it possible to have the output be values be a % of the largest number in the field, if so what would the tool/ macro I would use,

the output of the example would be as follows  

 

NameField 2Field 3Field 4Field 5Field X
A=1/24=8/13=12/142/10=3/13

B

=3/24=11/13=14/148/10=7/13
C=7/24=1/13=7/1410/10=13/13
D=10/24=13/13=3/144/10=8/13
Y=24/24=7/13=1/143/10=5/13

 

Thanks in advance,

Jonathan :)

6 REPLIES 6
binuacs
20 - Arcturus

@Johnnyt3883 

 

binuacs_0-1649174722354.png

 

mceleavey
17 - Castor
17 - Castor

Hi @Johnnyt3883 ,

 

To explain what @binuacs has done here and the functionality used, the first step is to pivot the data to get all values into a single column. This is done using the Transpose tool, and it pivots the data around a group field, in this case the Name column:

 

mceleavey_0-1649181015150.png

This gives the following format:

mceleavey_1-1649181041056.png

 

As you can see, all values are now in a single column.

The next step is to use a Summarize tool to determine the Max number for each field:

 

mceleavey_2-1649181102466.png

 

Which gives us the following values:

mceleavey_3-1649181121645.png

This can then be joined back to the pivoted data using the field Name2, which effectively provides the Max Value for each field:

 

mceleavey_4-1649181174983.png

 

We can then simply use a formula tool provide the calculations:

mceleavey_5-1649181204379.png

Which provides the following:

mceleavey_6-1649181276302.png

 

Then, we simply pivot the data back, but substituting the original value with the new calculated value.

This is done using the Crosstab tool:

mceleavey_7-1649181328019.png

 

And we end up with the following result:

mceleavey_8-1649181357900.png

 

The primary tools used in this workflow are the Transpose and Crosstab tools.

You can find out more about these tools here:

 

Transpose

Crosstab

 

I hope this helps,

 

M.

 

 

 

 

 

 

 

 



Bulien

binuacs
20 - Arcturus

@mceleavey Thanks for taking time and explaining each steps.

mceleavey
17 - Castor
17 - Castor

no problem.gif



Bulien

Qiu
20 - Arcturus
20 - Arcturus

@mceleavey @binuacs 
nice workflow and documentation!👍

Johnnyt3883
5 - Atom

Thank you @mceleavey @binuacs @Qiu for responding, great solution,

exactly what I was looking for,

 

Thanks again :) 

Labels