Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Cross tab with multiple fields

YanishDewan
7 - Meteor

Hi, 

 

I am trying to create a pivot table similar to excel by using cross tab on 2 fields at the same time. My source data is something similar to the below

 

AccountField 1Field 2Sum_ Amount
502009170CIR0
502009170URO0
50200936709990
5020093670LCS9346490
51000710BRI14874.14
51000710CER19840.16
51000710HYD-1403.36
51000710PIR3919.7

 

and the desired format is the following

 

 1010101017017036703670
AccountBRICERHYDPIRCIRURO999LCS
502009    0009346490
51000714874.1419840.16-1403.363919.7    

 

I essentially want the top row of my data table to be repeated/group by "Field 1" and "Field 2" respectively. On Excel I can achieve this by choosing "Field 1" and "Field 2" as "Columns" in a pivot table but I cannot figure out what is the process for Alteryx?

 

Any help will be much appreciated!

5 REPLIES 5
RolandSchubert
16 - Nebula
16 - Nebula

Hi @YanishDewan ,

 

the Cross Tab tool works on one field at a time, so you will need two Cross Tab tools (first one to cross tab SUM_Amount, second one for Field 2). Union the results and use a Dynamic Rename tool to change the headers. But - there is one problem. Headers have to be different for different fields, so the four columns label "10" will be "10", "10_2", "10_3", "10_4". I've attached a sample workflow, hope this helps.

 

Best regards

 

Roland

YanishDewan
7 - Meteor

Thanks @RolandSchubert  This is kind of what I needed. I had a look at the table tool which has a pivot table functionality in Alteryx (https://help.alteryx.com/2018.2/PortfolioComposerTable.htm). Looking at the "Beginning data example"  and the "Example Output" for the "Methodology over Variable", this looks more similar to what I want as a final output. 

 

Would you be able to advise how the example output was achieved for the data example?

fmvizcaino
17 - Castor
17 - Castor

Hi @YanishDewan ,

 

Unfortunately, it is not possible to achieve the result you want using the pivot table option.

 

I'm attaching 2 examples: one showing how to accomplish the configuration of the table tool example and one using your data.

From help: 'Pivot Style: Select the style for displaying the data in the table. This option is only available when using data from a Cross Tab tool'

 

Best,

Fernando Vizcaino

RolandSchubert
16 - Nebula
16 - Nebula

Hi @YanishDewan ,

 

as @fmvizcaino already explained,  the pivot table functionality works with cross tab data only (that's what you have), but it does not provide an option to "group" data the way you want.

 

But you can use the table tool to create the result you want by adjusting the headers (it's not very flexible ...). Is this an option?

 

Best regards

 

Roland

 

 

 

 

cyeager
7 - Meteor

I struggle with this as well.  One idea is to concatenate Field 1 & 2 in a Formula node ( i.e. [Field 1] + "-" + [Field 2] prior to the Cross-Tab, and then use as your column header.  You may have to change Field 1 to a V_String Type for it to concatenate.  It still isn't exactly what you'd like, but it gets you closer.  🙂

Labels