Solved

Convert Month text to number

  • 10 July 2017
  • 3 replies
  • 19 views

Badge +1

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

icon

Best answer by jdh 10 July 2017, 16:18

View original

3 replies

Badge +22

The AttributeValueMapper should work. Case matters.

Badge +1

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

regards

Simon Hume

Userlevel 2
Badge +17

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)

Reply