Hi Darius,
I would use the BulkAttributeRenamer with this settings.
Rename: Selected Attributes
Selected Attributes: Status Key
Action: Regular Expression Replace
Text to Find: .*
String: Status description <Attribute Value>
You can then merge records grouping by "Species, Aughorigy, Group" (Aggregater), and expose attribute names - AAAAA, BBBBB ... (AttributeExposer).
Takashi
Hi Takashi.
It doesn't really work. Whant I am trying to do is what in Access is called a Crosstab: tranferring duplicate rows to unique rows where the different duplications become colummns.
In my example, the duplicate values are the Species + Authority + Group], which may have different statutes. I just want the Species + Autority + Group] to appear once and their different status turn into a column.
Any ideas?
Thanks,
Darius
Hi Darius,
I suspect u will need to use 2 excelwriters to accomplish this using fme transformers.
Write 1st row t and then using second writer to append the rest to the same exceldataset and same featuretype (sheet).
To create the header for the " all status etc." You would need to creat 7 attributes and write them as 1st row in excel. 1st 3 attributes need to be empty, 4ht need to contain "" all status etc." and last 3 attriubtes empty again.
Yes lists are useful to build the structure.
Listbuilder grouped on
Species, Atoritha and Group.
Then a listconcatenoator on "status discription" or "status key" a
An attributesplitter on the created list, expose the elements and rename them ( to AAAA etc.).
Use a second excellwriter (same exceldataset and same featuretype as prioro writer) and set start row to second row.
Gio
..actually excelwriter will protest to that...(or you might get a 14 column sheet...)
So:
U need to create a dummy headerrow consisting of 7 attributes. Call them whatever; attr1 trough 7.
Fill second row with values of 1st one i suggested. (the attributes will become values)
Fill third and rest with the values created in second part. (again attriubtenames and values will become values of attr1 through 7)
Now u only need one Excelwriter.
You will need to delete the dummy row in excel.
Fme excelwriter does not give fulle Excelcontrol (yet?). (for that you would maybe want to use more python or tcl).
Gio
hmm... try this workflow.
Takashi,
I have tried again and this workflow doesn't work.
First problem: the the bulkattributerenamer does not replace the value of status key for status description.
Second problem.: when I aggregate, the duplications disappear and I really need the different values of statuses to convert them into columns.
Third problem: when I try to expose the status description, the attributte is not on the dropdown list.
For some reason, I believe that this is case has to be done with lists.
Thanks,
Dario
Dynamically renamed attributes will not be shown in interface of Workbench unless you expose them explicitely. You can type required attribute names directly in the AttributeExposer.
Sorry guys (Gio/Takashi),
I don't think any of these ideas will work.
This operation is what is called a
CrossTab query in Microsoft Access and I believe FME is very poor for this type of operations. In Access takes, actually, just a few minutes to perform the query and obtain the second table showed above.
I think I will keep using Access in the meantime that probes to be quicker and more efficient for these type of operations than FME.
Thanks,
Dario