Solved

How to: Transposing/concatenating problem.

  • 28 January 2022
  • 4 replies
  • 3 views

Can't wrap my head around the following reformatting problem. My data looks like this:

Pointid substance1 substance2 substance3...

1 value

2

3

I have a lot of columns in the original data, almost 200 different substances. I would like to achieve the following structure (below) where Substances attribute contains all values of 200 substance columns and is exploded for each Pointid. So basically every Pointid is replicated for each substance and values column have the value of each substance. I've tried multiple combinations of transformers but without result.

Pointid Substances values

1 Substance1 value

1 Substance2 ...

1 Substance3

2 Substance1

2 Substance2

...

icon

Best answer by nielsgerrits 28 January 2022, 13:14

View original

4 replies

Userlevel 6
Badge +32

I think you can solve this with an AttributeExploder.

Userlevel 6
Badge +32

I think you can solve this with an AttributeExploder.

Attached sample workspace.

AttributeExploderSample

Userlevel 2
Badge +17

Hi @japeki​ , alternatively you can use the ListPolulator to populate all the values of Substance* attributes into a list attribute.

listpopulator-example 

Attached sample workspace.

AttributeExploderSample

This seemed to work thank you! I've tried AttributeExploder before but somehow didn't get the same result.

Reply