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

X-Y Axis Data Visualization - Transpose only a few columns

mvyjayanti
5 - Atom

Hi,

 

I'm trying to transpose only a few of my columns so I can visualize my data in a heat-plot.

 

Eg. of my data (the following data is fake and made-up just for this post):

 

 

YearAirlineMealDietary RestrictionCount
2000UnitedBreakfastVegetarian150
2000AmericanLunchNon-vegetarian175
2000DeltaDinnerNon-vegetarian105
2001UnitedDinnerVegetarian7
2001Air IndiaBreakfastVegetarian145
2002AmericanDinnerNon-vegetarian139

 

Desired Results:

 

 UnitedUnitedUnitedUnitedUnitedUnitedAmericanAmericanAmericanAmericanAmericanAmerican
 Breakfast BreakfastLunchLunchDinnerDinnerBreakfast BreakfastLunchLunchDinnerDinner
 VegetarianNon-vegetarianVegetarianNon-vegetarianVegetarianNon-vegetarianVegetarianNon-vegetarianVegetarianNon-vegetarianVegetarianNon-vegetarian
Year            

2000

150        175  
2001    7       
2002           139

 

I hope this makes sense. 

Basically, I want to transpose everything but my year column so I can filter by year and look across to see all the available data for each airline, meal, and dietary restriction.

 

I'd highlight cells by value at that point.

 

6 REPLIES 6
Jotigautam
10 - Fireball

@mvyjayanti 

Could you please explain why three line header is needed. If the requirement is to just filter by year and show heat map, you can create a string by clubbing three columns and then cross tab

 

Jotigautam_0-1657718946011.png

 

mvyjayanti
5 - Atom

@Jotigautam

 

I need the multi-line header as I want the headers to show all possible values. The table will show blanks where those values do not exist (e.g. American - Lunch - Vegetarian)

 

A future step would be to merge the headers for visualization purposes.

 

I was able to arrange the table in this way via excel pivot table: 

- Rows: Year

- Columns: Airline, Meal, Dietary Restriction

 

However, I would prefer to do this in Alteryx.

Amol_Telore
11 - Bolide

Hey @mvyjayanti 

 

Here is my solution. Hope this resolves your issue.

 

Amol_Telore_0-1657728221407.png

Note :- Thou, we are showing first 3 records as Header in report and it is dynamically working. It is still part of data and if you try to read output file again in another process, it will be read as data (from 1st row) not header.

mvyjayanti
5 - Atom

Thanks @Amol_Telore

 

Do you know if there's a way to see all possible values in the headers?

 

e.g. 

UnitedUnitedUnitedUnitedUnitedUnited

Breakfast

BreakfastLunchLunchDinnerDinner
VegetarianNon-vegetarianVegetarianNon-vegetarianVegetarianNon-vegetarian

 

Amol_Telore
11 - Bolide

@mvyjayanti Your input data delta and Air India airlines which is not present in desired output. Are we excluding any other airlines except United and American?

Amol_Telore
11 - Bolide

As per desired output, I have done some changes in the workflow. PFA.

 

Amol_Telore_0-1657730830260.png

 

Labels