07-08-2020 03:06 AM
Hi everyone,
I am stuck in one transformation I have one student_id which have different marks with subjects and I want to divide it in rows without using copy snap. PFA
The records are coming in this format
And I want to manipulate this records in This way for each ID
I am also attaching the pipeline on which I have worked but I am searching for using less snap and without copy snap
Copy Pipeline_2020_07_08.slp (12.3 KB)
Thanks in advance
Solved! Go to Solution.
07-08-2020 11:01 AM
Wow, can’t believe it took me this long to learn of the Pivot snap. 🙂
Yes, that works nicely for this:
07-08-2020 08:52 AM
Try this pipeline:
StudentMarks_2020_07_08.slp (5.2 KB)
It looks like this:
The key step is the Mapper:
Here’s the expression on the third row:
$.entries()
.filter(pair => [‘student_id’,‘Total’].indexOf(pair[0]) < 0)
.map(pair => { Subject: pair[0], Marks: pair[1] })
Please see my article on Medium where I explore such transformations in more depth:
07-08-2020 09:32 AM
Have you tried the Pivot Snap?
07-08-2020 11:01 AM
Wow, can’t believe it took me this long to learn of the Pivot snap. 🙂
Yes, that works nicely for this:
07-08-2020 08:50 PM
Thank @ptaylor It works