Skip to main content
Question

What is the Syntax for Tester In Operator when using Sting Values

  • February 17, 2017
  • 6 replies
  • 13 views

Hi All,

I seem to not be able to get the Tester to work using the in operator when trying to use Sting values.

I am trying to turn the ArcGIS definition query expression Workpack IN ("WDS - SP1", "WDS - SP2", "WDS - SP3") into the right syntax to place into the Tester.

Having the () on either side gave me nothing, I had some luck with the right value being "WDS - SP1", "WDS - SP2", "WDS - SP3", however this only returned values for WDS - SP1.

 

Cheers

Matt

6 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • February 17, 2017

HI @mgerbz,

Try : WDS - SP1,WDS - SP2,WDS - SP3


Forum|alt.badge.img+7

Hi @mgerbz

 

It works when you don't use the quotes around the test-values:


takashi
Influencer
  • February 17, 2017
jeroenstiers wrote:

Hi @mgerbz

 

It works when you don't use the quotes around the test-values:

hmm, I'm afraid that it may not work. You need to remove the excess whitespaces following to the commas, but I think the double quotations would be necessary in the question case, since the test-value contains a hyphen which is a special character used to specify a range of value in the In operator use.

 

"String ranges (i.e. a-d) can also be specified. If you want to test for values that contain a hyphen, those values should be enclosed in quotation marks. For example, if x=LL-27, then x In "LL-27","LL-83" would be true. On the other hand, x In LL-27,LL-83 would be false." -- Help on the Tester

 


takashi
Influencer
  • February 17, 2017
itay wrote:

HI @mgerbz,

Try : WDS - SP1,WDS - SP2,WDS - SP3

Yes, the excess whitespaces should be removed, but the double quotations have to be left in this case.

 

"String ranges (i.e. a-d) can also be specified. If you want to test for values that contain a hyphen, those values should be enclosed in quotation marks. For example, if x=LL-27, then x In "LL-27","LL-83" would be true. On the other hand, x In LL-27,LL-83 would be false." -- Help on the Tester

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • February 17, 2017
takashi wrote:
Yes, the excess whitespaces should be removed, but the double quotations have to be left in this case.

 

"String ranges (i.e. a-d) can also be specified. If you want to test for values that contain a hyphen, those values should be enclosed in quotation marks. For example, if x=LL-27, then x In "LL-27","LL-83" would be true. On the other hand, x In LL-27,LL-83 would be false." -- Help on the Tester

 

Ha missed that on the hyphens, good catch @takashi !

 


  • Author
  • March 10, 2017

Thanks @takashi it was exactly as you said it. I had to keep the double quotation makes, AND remove all white space outside of the quotation marks (aka, only the comma should exist)


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