It’s been several times I can’t achive to do this, but I’m sure there is a way.
I have the following table :
And I want to get the following result :
The thing is : I don’t know in advance what will be the name of IndA and IndB (and there can be more than 2 values, so more than 2 columns in the result table).
I achieved to get my result table with an inlineQuerier, but I need to enter a fixed value for the Indicateur values.
Since we migrated to the new community platform, time to edit is limited to something like 30 minutes.
p.jeremie wrote:
Hi,
It’s been several times I can’t achive to do this, but I’m sure there is a way.
I have the following table :
And I want to get the following result :
The thing is : I don’t know in advance what will be the name of IndA and IndB (and there can be more than 2 values, so more than 2 columns in the result table).
I achieved to get my result table with an inlineQuerier, but I need to enter a fixed value for the Indicateur values.
This can be done by simply using an attributecreator like this:
And then merge the rows into one using an Aggregator like this:
But as these attributes are created at runtime, workbench can not know what they are. They are unexposed. But you can see the values in the Feature Information window:
So the question is, what do you want to do with the data after transposing?
If you want to simply write the transposed data to a table, write it using a dynamic workflow. One way to do this is to use a SchemaScanner transformer to create a Schema Feature and use that as input for a dynamic FeatureWriter.
If you want to do something with the transposed data in the workflow, downstream the transpose action, you will need to expose the created attributes using an AttributeExposer.
Since we migrated to the new community platform, time to edit is limited to something like 30 minutes.
p.jeremie wrote:
Hi,
It’s been several times I can’t achive to do this, but I’m sure there is a way.
I have the following table :
And I want to get the following result :
The thing is : I don’t know in advance what will be the name of IndA and IndB (and there can be more than 2 values, so more than 2 columns in the result table).
I achieved to get my result table with an inlineQuerier, but I need to enter a fixed value for the Indicateur values.
This can be done by simply using an attributecreator like this:
And then merge the rows into one using an Aggregator like this:
But as these attributes are created at runtime, workbench can not know what they are. They are unexposed. But you can see the values in the Feature Information window:
So the question is, what do you want to do with the data after transposing?
If you want to simply write the transposed data to a table, write it using a dynamic workflow. One way to do this is to use a SchemaScanner transformer to create a Schema Feature and use that as input for a dynamic FeatureWriter.
If you want to do something with the transposed data in the workflow, downstream the transpose action, you will need to expose the created attributes using an AttributeExposer.
In the meantime, I achieved to do what I want with nearly the steps you mention, not being sure it was a great solution.
I used the AttributeCreator and then the Aggregator and get my attributes per Zone (unexposed).
Then I used the ExcelWriter with dynamic schema.
My issue was “how to create the destination schema ?”. I achieved to do so with a ListBuilder : creation of an attribute{} list with name and fme_data_type.
SchemaScanner is not available in FME 2020 that I still use, but it seems and interesting solution, I’ll give it a try.
I still had the issue that my Zone attribute, that I let in the User attributes tab of the ExcelWriter, was written as the last column in Excel file. I added a attribute{0} with name Zone in the schema, and it solved my issue.
So this seems to be the right solution to do it, and maybe simpler with SchemaScanner starting with FME 2022.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.