chorsell_1 Posted May 10, 2014 Share Posted May 10, 2014 Hi, i am trying to create a calculated field. For example i have fields which contain ABC 01, ABC 02 etc.What i want is to have a new field calculated based on whether a field has 01 in it.I can do it if i say field equals ABC 01 (in other words the whole value) by using something like this if(public_incidentreportdonotuse_212.tenancyname_c358 == 'ABC 01','MALL1', if(public_incidentreportdonotuse_212.tenancyname_c358 == 'ABC 02','Mall2'))But not by just looking for part of the value. The reason i need this is i may have 100 values with a different ABC but with 01 at the end. Link to comment Share on other sites More sharing options...
bolsover Posted May 10, 2014 Share Posted May 10, 2014 $F{FieldA}.endsWith("01") ? "ValueIfTrue" : ValueIfFalse"or $F{FieldA}.contains("01") ? "ValueIfTrue" : ValueIfFalse"or$F{FieldA}.startsWith("01") ? "ValueIfTrue" : ValueIfFalse" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now