Skip to main content

FME Desktop 2022: How to specify the type of created attribute field (chr, double, integer, etc.)?

 

I couldn’t figure out how to specify the type of the attribute field

 

In the screenshot below, I created the “AreaPercent” attribute but couldn’t figure out how to specify its type. However, as it’s written in a feature class geodatabase, it’s considered as “chr”.

 

How this can be managed?

 

Clip_183 

Clip_184 

 

 

 

 

 

 

Hi @jamal​,

do you need the Automatic Attribute Definition? You can change the type at the Manual option. Here is an idea to handle it within the AttributeManager:

AC Idea: Set Data Type option within the AttributeManager (safe.com)


I tried the suggestion proposed by bleutzinn but appears not to work with me.

What could be the issue here?

 

Clip_188 

Clip_189 

 

 

 


Despite the fact that the "user parameter" is seletced with "number type, it fails to be wittern in the file geodatabase as number

What could be the issue here?

 

 

Clip_197 

Clip_196 

 

 

Clip_198 

 

 

 

 

 

 


Despite the fact that the "user parameter" is seletced with "number type, it fails to be wittern in the file geodatabase as number

What could be the issue here?

 

 

Clip_197 

Clip_196 

 

 

Clip_198 

 

 

 

 

 

 

If you switch the Attribute Definition to Manual (in your writer feature type) you'll be able to change attribute types. Internally FME is pretty flexible with attribute types, it's only really handled on the writers.


But I need to have the writer to be dynamic but not manual so that all changes made at the level of attribute manager are reflected directly on the writer

 

Clip_207 

 


But I need to have the writer to be dynamic but not manual so that all changes made at the level of attribute manager are reflected directly on the writer

 

Clip_207 

 

That's why you need to do that as the very last step of your workspace design process. If you leave it on automatic FME will do a best guess based on the workspace to what those types should be, but you as a designer know that much better. One of the things you'll see is that a lot of your attributes are set to char(200), which is almost certainly going to be way too much.


It would be much more powerful if we get the chance to specify the field type as it's created. This way all should work fine


It would be much more powerful if we get the chance to specify the field type as it's created. This way all should work fine

But you can specify it. On the writer feature type.


Then how to work on this case:

In the screenshot below, I'm converting data from AutoCAD that represents the Area. Then how the FME can understand this data as number so that i can apply calculations?

 

Attached

 

Clip_210 

Clip_211 

 

 

 


Then how to work on this case:

In the screenshot below, I'm converting data from AutoCAD that represents the Area. Then how the FME can understand this data as number so that i can apply calculations?

 

Attached

 

Clip_210 

Clip_211 

 

 

 

If it's a number, you can do calculations on it. If not, then not. I used an AttributeCreator to create a new attribute and filled it (using the Arithmetic Editor, otherwise you'll get a text string) with a new calculated value

Screenshot 2022-03-08 at 11.54.15Screenshot 2022-03-08 at 11.54.25If FME can't make a number out of it and you try and do calculations it'll fail (or more precisely, it'll return <null>), so if there is a likelihood of the texts not all being numbers you'll need to account for that, for example with an AttributeValidator

 


Thanks for the approcah

FME gets them as numbers (which is good for me), nevertheless, they are aligned left in the column as if they are Texts!

 

 

Clip_217


Thanks for the approcah

FME gets them as numbers (which is good for me), nevertheless, they are aligned left in the column as if they are Texts!

 

 

Clip_217

Yes. But they are numbers. Internally, FME does not really care that much. If it looks like a number FME can treat it like a number.


Reply