Home Data Prep Q&A

Paxata Community Members: Something special in a community experience is coming your way. Stay tuned to this space.
In the meantime, check out the brand new Data Prep for Data Science topic here and the new DataRobot Community.

Visit the official Paxata Documentation portal for all of your doc needs.

Transform table that has each year as its own column into 1 year column

Sample of the Current Table. 
Sport 2017 2013 2008 2007 2006 2005 2004
Football 37 39 41 43 43 34 37
Basketball 11 12 9 11 12 12 13
Baseball 9 14 10 13 11 12 10
Soccer 7 4 3 2 2 3 2
Ice hockey 4 3 4 4 2 4 3

Sample of Desired Resulting Table
Sport  Year Value
Football 2017 37
Basketball 2017 11
Baseball 2017 9
Soccer 2017 7

Best Answer

  • bstephensbstephens Posts: 44 mod
    Accepted Answer
    @marvis2

    You'll want to use the Shape->Depivot operation. 

    Using your sample data, I used the following transformation to get the desired data structure.  The "REST" button allowed me to select all remaining columns for Values 


    I hope this helps,
    Bill

Answers

Sign In or Register to comment.