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.

Move row data to column headings and count occurances

EmAnna
6 - Meteoroid

Hi all, 

 

Again, am new to Alteryx (amazing software!)

 

I have the data in red below, but want it to look like the green. 

 

Anyone know how to do? Thank you!

 

EmAnna_0-1669641340269.png

 

4 REPLIES 4
gautiergodard
13 - Pulsar

Hey @EmAnna 

Welcome to Alteryx!

Here is one way you could do this:

gautiergodard_0-1669642027930.png

 

Hope this helps!

DataNath
17 - Castor
17 - Castor

Hey @EmAnna here's how I'd go about this:

 

DataNath_0-1669641971973.png

 

1) Transpose the data, bringing each of the values (1,2,3) into a single field

 

DataNath_1-1669642016059.png

 

2) Summarize the data, grouping by Station/Location to maintain that split, as well as [Value] to group by the outlet and then get each of their counts:

 

DataNath_2-1669642061833.png

 

3) Filter out null values in order to prevent an additional field in the end result for nulls:

 

DataNath_3-1669642098300.png

 

4) Cross-Tab the data to bring your outlet names into the headers and their counts into the rows:

 

DataNath_4-1669642122254.png

 

5) Apply a Multi-Field Formula to convert all null values into 0s to clean up results:

 

DataNath_5-1669642149064.png

 

Hope this helps! Please shout up if you have any questions.

EmAnna
6 - Meteoroid

Hi - thanks so much for the above!

I understand Step 1 transpose, Step 5 non-null 

 

Could you explain step 2-4 a bit more? Understand how cross tab works, but the count bit is kinda new? 

 

Thanks!!

DataNath
17 - Castor
17 - Castor

No problem @EmAnna. Absolutely!

 

So in step 2 (Summarize) we're basically saying to Alteryx... If we split the data into each Station/Location/Store combination, how many times does that appear. For example, for station A, we further group by Peterborough and then BP, for which there is 1 occurrence and so that brings back the count of 1 - same for Greggs. For the other stores, these never appear within that Station & Location and therefore their count is null (zero).

Labels
Top Solution Authors