01-10-2020 02:16 AM
hi ,
I have a requirement where in to read the .xls file which is having data and transpose the columns into rows and create a csv file as a output . Below is the screenshots for the input and output . i tried in pivot its working but the columns will be dynamic . Suppose pid and pname is constant but the data coming in the file varies day to day . Is there anyway that we can achieve this scenario .
09-16-2020 06:10 AM
Hi,
Did you find out a solution for this in snaplogic?If yes, can you please share with me . I kind of need similar to this for my workcase.
03-30-2021 07:34 AM
Hi Precy,
Did you ever find a solution for this? I have the same use case.
03-30-2021 08:18 AM
Hi,
I used below function to get it done.
$.entries().filter(x => ['Fields to be not part of pivot’].indexOf(x[0]) == -1).map(x => { Fieldname: x[0], Field Data Column Name : x[1] })
03-30-2021 07:55 AM
You basically want to look at the Array functions to do something like this generically.
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438091/Array+Functions+and+Properties
I’ve attached a sample pipeline that converts the date columns into an array then uses JSON Splitter to get individual records.
Generic Pivot Example_2021_03_30.slp (4.7 KB)