cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Transpose array row to columns

Precy
New Contributor

Hi Team,

I need to convert the values present in an array with comma separated into different columns. Not sure how to use pivot snap for this logic, can someone help me with the same?

image

4 REPLIES 4

SpiroTaleski
Valued Contributor

Hi @Precy,

Instead using the pivot snap, you can try with the โ€œtoObjectโ€ function.

I am attaching simple pipeline, please take a look/validate and see the output preview.

SL_Community_2020_08_31.slp (4.7 KB)

If this not works for you, please provide the desired output that you want to achieve.

Regards,
Spiro Taleski

Precy
New Contributor

Thanks @Spiro_Taleski,

That worked like a piece of cake.
Now i want to place the input present in Value array to the transposed column respectively.

image

I tried $ASSETATTRID.toObject(x => x, x =>( $VALUE.toObject(x => x))), but not working as expected. When we have any input like [null,โ€˜testโ€™,null,โ€ฆ]

Precy
New Contributor

Let me give you in detail my requirement. Below is the input

image

where input present in ASSETATTRID array to be transposed as columns which is working, and input present in VALUE array to be distributed as a value to respective transposed columns.

I need the output as follow:

image

SpiroTaleski
Valued Contributor

Hi @Precy

Please take a look at the attached pipeline:

SL_Community_2020_09_01.slp (4.8 KB)

Hope this will meet the provided requirement.

Regards,
Spiro Taleski