Solved

Transform matrix table to simple table


Badge

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!

icon

Best answer by nielsgerrits 8 March 2021, 09:36

View original

10 replies

Userlevel 6
Badge +33

I think you forgot to attach the screenshot.

Badge

Sorry, added.

Userlevel 6
Badge +33

You are looking for the AttributeExploder.

Badge

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.

Userlevel 6
Badge +33

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.

Userlevel 1
Badge +21

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

Badge

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!

Badge

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!

Userlevel 6
Badge +33

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.

Badge

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!

Reply