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.

?transpose

vivian123
7 - Meteor

Hi all, 

 

I'm wondering what the best way to work through this is? I'm thinking the transpose tool but am not sure how to go about this afterwards. 

 

I have this table:

 

Student IDWeek 1 gradeWeek 2 gradeWeek 3 gradeWeek 4 gradeWeek 5 grade
11160 8090 
222 9080  
333  50 70

 

I'd like the output table to have the grade from the earliest week, which week this was, and the total number of grade- output table:

Student IDFirst gradeWeekTotal number of grades
1116013
2229022
3335032

 

Is this possible?

 

Thanks!

2 REPLIES 2
apathetichell
18 - Pollux

Yes! And I'm going to point you in the right direction instead of giving you a workflow...

 

Here's what you'll need to do to start:

1) transpose (student id as key column).

 

2) Your name column will now have the various weeks - and your value column will have the grades. Perhaps a summarize tool with some options (include a count non-null) could help?... You'll have to rejoin using student id as a primary key after.

 

3) after you've rejoined you have the total number of grades and the student id but you need to get your first grade and where that ocured. You can use the original transposed version to get that. You can isolate week from [name] by creating a new field in the formula tool. you can use regex_replace([name],".*(\d+).*","$1") to get the number from the [name] column...

 

4) now at 3/4 of the way done you'll have to find first grade. There's a few ways to do this. multi-row formula. sample tool, summarize. play around with and come back if you are totally lost.

  •  
Qiu
20 - Arcturus
20 - Arcturus

@vivian123 
Maybe something like this?

Capture3.PNG

Labels