Skip to main content
Solved

Attribute Manager trouble


Forum|alt.badge.img

I am new to FME, so pardon the basic nature of this question. But I am trying to normalize my data.

Standardization of names, such as Chevrolet to Chevy. Remove a leading " " and change the case of words.

Here is what I have done:

It seems logical to me, but my output doesn't get applied to my excel:

Any help would be appreciated.

Thanks,

Best answer by cquadrini56

Hi Holly,

So I figured it out. My excel writer I think was appending, so I wasn't see new data. If I deleted my excel output, and let it regenerate all the data is modified the way I was hoping it to be.

Thanks for your help.

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

10 replies

Forum|alt.badge.img
  • Author
  • October 15, 2018
Iamges didn't take 1st time

 

 

 

 


Forum|alt.badge.img
  • Author
  • October 15, 2018

 

3rd Time was the charm

 


Forum|alt.badge.img+2

Hi @cquadrini56,

First I think it would be easier to use the AttributeTrimmer transformer to remove the quotation marks - rather than specifying @Trim multiple times - however if you do use this string function the format needs to be : Trim(str, [chars]), else if chars is not specified then only white space will be removed.

Second in the Output value you just need to specify Chevy/GMC - since the test is already finding only those with Chevrolet, with your current set up the output value would be 'Chevrolet=Chevy' rather than just 'Chevy'. The AttributeValueMapper is another transformer you could look at to do this.

This is the set up you would need in your AttributeManager:


Forum|alt.badge.img
  • Author
  • October 15, 2018
hollyatsafe wrote:

Hi @cquadrini56,

First I think it would be easier to use the AttributeTrimmer transformer to remove the quotation marks - rather than specifying @Trim multiple times - however if you do use this string function the format needs to be : Trim(str, [chars]), else if chars is not specified then only white space will be removed.

Second in the Output value you just need to specify Chevy/GMC - since the test is already finding only those with Chevrolet, with your current set up the output value would be 'Chevrolet=Chevy' rather than just 'Chevy'. The AttributeValueMapper is another transformer you could look at to do this.

This is the set up you would need in your AttributeManager:

Hi Holly,

I am sorry for not being clear, when I typed " " I meant a white space. Trim, nor the trimmer wanted to take it off. My excel output still had the leading space.

As fort he casing situation, I want the casing to be First letter of the word, unless it is an anagram, such as GMC, that was why my thinking said to call it out, but my logic could be flawed here, so anyway to do it is appreciated.


Forum|alt.badge.img+2
hollyatsafe wrote:

Hi @cquadrini56,

First I think it would be easier to use the AttributeTrimmer transformer to remove the quotation marks - rather than specifying @Trim multiple times - however if you do use this string function the format needs to be : Trim(str, [chars]), else if chars is not specified then only white space will be removed.

Second in the Output value you just need to specify Chevy/GMC - since the test is already finding only those with Chevrolet, with your current set up the output value would be 'Chevrolet=Chevy' rather than just 'Chevy'. The AttributeValueMapper is another transformer you could look at to do this.

This is the set up you would need in your AttributeManager:

Note: I've used the @UpperCase function for the GMC value but you could just set the value to GMC as you did originally also.

 


Forum|alt.badge.img+2
cquadrini56 wrote:

Hi Holly,

I am sorry for not being clear, when I typed " " I meant a white space. Trim, nor the trimmer wanted to take it off. My excel output still had the leading space.

As fort he casing situation, I want the casing to be First letter of the word, unless it is an anagram, such as GMC, that was why my thinking said to call it out, but my logic could be flawed here, so anyway to do it is appreciated.

Hi @cquadrini56,

 

 

Can you provide a sample of the data you are using and I can take a look as to why the @Trim might not be working?

 

Sorry I misunderstood the casing! is GMC the only anagram you have?

 


Forum|alt.badge.img
  • Author
  • October 15, 2018

HI Holly,

In excel, I ran this code =code(CELL) on the cell where you see SPACE Gmc. I got a value of 32 returned, which is ASCII for space. SO all indications say TRIM should work. This is why I am so confused as to what I am doing wrong. I have tried to trim attribute too bc it is straight forward but the data is not changing.

I can give you a snippet of data:

ChevySILVERADO2012 CHEVY SILVERADOGMCSierra2013 GMC SierraFordF3502017 Ford F350GMCSERRIA2013 GMC SERRIAGMCSIERRA2012 GMC SIERRA Gmc Sierra2013 GMC SierraChevrolet Silverado 15002012 Chevrolet Silverado 1500GMCSIERRA2012 GMC SIERRAFordF350

2017 Ford F350


Forum|alt.badge.img
  • Author
  • October 15, 2018

Hi Holly,

I think my last work was corrupted because I had it working...for a bit. Now, my excel is showing changes that are not part of my mapper. They were, but since I am playing around they no longer are. I think FME mappers can get corrupted if you play around too much.

Thoughts?


Forum|alt.badge.img
  • Author
  • Best Answer
  • October 15, 2018

Hi Holly,

So I figured it out. My excel writer I think was appending, so I wasn't see new data. If I deleted my excel output, and let it regenerate all the data is modified the way I was hoping it to be.

Thanks for your help.


Forum|alt.badge.img+2
cquadrini56 wrote:

Hi Holly,

So I figured it out. My excel writer I think was appending, so I wasn't see new data. If I deleted my excel output, and let it regenerate all the data is modified the way I was hoping it to be.

Thanks for your help.

Hi @cquadrini56,

 

 

Ah glad to hear you figured it out. In future rather than deleting and re-adding the excel writer there are options you can set up with how to handle the existing sheet e.g. Overwrite Existing File or drop/truncate existing sheets.

 

http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/xlsx/XLSX_writer.htm

 


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