Skip to main content
Solved

attribute creator

  • June 4, 2015
  • 1 reply
  • 25 views

ingalla
Contributor
Forum|alt.badge.img+10
Hello

 

I have a very simple query about attributes but can not get the right result for the life of me.

 

I have a text attribute called CHANGE.  This includes a date and text as shown below:-

 

2014-09-26 New

 

I have a tester which finds all of the words NEW within that field and lets them pass the Tester, this works fine.

 

I then need to extract the year, the first four digits and create an attribute called year, place the year value within that attribute..

 

 

I managed to get the year out into a list, which works fine in inspector, but does not get transferred accross to the shape file.  What could be wrong?

 

 

Thanks in advance.

Best answer by gio

UYou could parse out the word "NEW", remove the space and convert the attirbute to a date field. Then you can extract the year using a datefunction or transformer.

 

 

Or you could just parse out $(\\d{4}).*
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Best Answer
  • June 4, 2015
UYou could parse out the word "NEW", remove the space and convert the attirbute to a date field. Then you can extract the year using a datefunction or transformer.

 

 

Or you could just parse out $(\\d{4}).*