Skip to main content
Solved

Convert Month text to number


simonhume
Contributor
Forum|alt.badge.img+2

Hi

I have a simple spreadsheet that has a month column in text ie January, February.

How do i convert this to a number? So for January it would be 01, February 02 etc etc.

I've tried using AttributeValueMapper with the following source value;

@Value(Month)='January'

and a destination value of 01

but no luck.

Would be grateful if someone could suggest how i can do this

thanks

Simon Hume

Best answer by jdh

The AttributeValueMapper should work. Case matters.

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

3 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • July 10, 2017

The AttributeValueMapper should work. Case matters.


simonhume
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • July 11, 2017

Thanks very much for you help, has worked a treat#

regards

Simon Hume


takashi
Influencer
  • July 11, 2017

Just for your information. The StringPairReplacer could also be uses here. And, I found this expression works fine in FME 2017.1 beta. FME 2017.1 coming soon!

@DateTimeFormat(@DateTimeParse(@Value(month)012017,%B%d%Y),%m)


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