Skip to main content
Solved

Transform matrix table to simple table


Forum|alt.badge.img

Hi dear FME experts,

I have a task to transform matrix style table into simple (flattened) one like on the screenshot below:

tableTransformI can unpivot it in Excel, but Is there a way to do this in FME with standard or maybe custom transformers?

If yes could you please post some examples?

Thank you very much in advance!

Best answer by nielsgerrits

nielsgerrits wrote:

If you share a sample of your data, like the part of you printscreen, I can create a sample workspace. Otherwise I have to reproduce your sample data as well.

Here you go.

View original
Did this help you find an answer to your question?

10 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

I think you forgot to attach the screenshot.


Forum|alt.badge.img
  • Author
  • March 5, 2021

Sorry, added.


nielsgerrits
VIP
Forum|alt.badge.img+54

You are looking for the AttributeExploder.


Forum|alt.badge.img
  • Author
  • March 5, 2021

Yes it is somewhere around AttributeExploder, but I can't figure out logic of how to do exactly what I've described. Any examples would be much appreciated.


nielsgerrits
VIP
Forum|alt.badge.img+54
siriosus wrote:

Yes it is somewhere around AttributeExploder, but I can't figure out logic of how to do exactly what I've described. Any examples would be much appreciated.

If you share a sample of your data, like the part of you printscreen, I can create a sample workspace. Otherwise I have to reproduce your sample data as well.


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • March 5, 2021
siriosus wrote:

Yes it is somewhere around AttributeExploder, but I can't figure out logic of how to do exactly what I've described. Any examples would be much appreciated.

You want to have a workflow something like this

Explode the attributes, set the Attribute Name Label to "Unit" and the Attribute value Label to "Value", set Keep Attributes to Yes (as you want to keep the Date attribute, you'll get rid of the others later), use a Tester to keep only those records where the Unit attribute starts with Unit, finally an AttributeKeeper to keep only the Date, Unit & Value Attributes

Capture


Forum|alt.badge.img
  • Author
  • March 7, 2021
nielsgerrits wrote:

If you share a sample of your data, like the part of you printscreen, I can create a sample workspace. Otherwise I have to reproduce your sample data as well.

Yes, sure please find in the attachment to this message. Thank you very much in advance!


Forum|alt.badge.img
  • Author
  • March 7, 2021
ebygomm wrote:

You want to have a workflow something like this

Explode the attributes, set the Attribute Name Label to "Unit" and the Attribute value Label to "Value", set Keep Attributes to Yes (as you want to keep the Date attribute, you'll get rid of the others later), use a Tester to keep only those records where the Unit attribute starts with Unit, finally an AttributeKeeper to keep only the Date, Unit & Value Attributes

Capture

Great! Thank you for your efforts and help. I'll try your suggestions for sure. I've posted data sample upper as well. Thanks again!


nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • March 8, 2021
nielsgerrits wrote:

If you share a sample of your data, like the part of you printscreen, I can create a sample workspace. Otherwise I have to reproduce your sample data as well.

Here you go.


Forum|alt.badge.img
  • Author
  • March 8, 2021
nielsgerrits wrote:

If you share a sample of your data, like the part of you printscreen, I can create a sample workspace. Otherwise I have to reproduce your sample data as well.

Yes - that's exactly what I was looking for! I found couple of tutorials which describes table pivoting but couldn't make it work. You did it just easy.

Thanks again for your help!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings