How to go from flat relational data to nested object oriented data

DougW
DougW Registered Posts: 4 ✭✭✭

I am trying to combine multiple rows into a single nested json object. I know how to do the opposite (i.e. flatten), but cannot find the right tool to go the opposite direction.

As an example, I start with this data:

Class, Student, Grade

1, Sally, A

1, Matt, A

1, Phil, C

What I want as an output is a single record:

Class, Grades

1, {{"Student": "Sally", "Grade": "A"}, {"Student": "Matt", "Grade": "A"}, {"Student": "Phil", "Grade": "C"})

Is there a way to do this with Dataiku?

Best Answer

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,925 Neuron
    Answer ✓

    Is there a way to do that in Dataiku using the standard recipes? ⇒ No

    Or do I need to write a custom Python function to do it? ⇒ Yes

Answers

Setup Info
    Tags
      Help me…