Erroneous results produced by 'Query widget'

1177
12
05-20-2021 09:11 AM
SimonCrutchley
Occasional Contributor II

I am using Portal 10.8 and Web App builder to create a simple app for viewing and accessing heritage data. One query I need to run relates to the period of the various features, many of which are multiple e.g. BRONZE AGE\IRON AGE\ROMAN. I have tried using the filter with 'CONTAINS' and multiple defined options (see attached 1 & 2). When I select BRONZE AGE the query correctly finds those features that include BRONZE AGE, but when I select ROMAN, the query finds almost all the records (attached 3), although there are only 5 ROMAN records. 

Using a single search and entering ROMAN as a defined entry, finds the correct 5 records (attached 4).

Can anyone think why this might be happening, and what I can do to resolve it?

Thanks

Tags (1)
0 Kudos
12 Replies
jcarlson
MVP Frequent Contributor

It's hard to know what's going on without seeing the full details. Can you get the query widget to display the actual SQL that's being sent to the service? From the first picture, it looks like there's a "contains" and a "does not contain" statement in the same query?

- Josh Carlson
Kendall County GIS
0 Kudos
SimonCrutchley
Occasional Contributor II

Is that better? Sorry I tend to turn off the SQL, so as not to confuse my users.

As you can see it's looking for %ROMAN%, but for some reason finding it in 'BRONZE AGE\IRON AGE'.

It may, or may not be relevant, but elsewhere I'm using the standard abbreviations to link to other URLs, and for ROMAN the abbreviation is RO, which does occur in both IRON and BRONZE. However, as I say, this is a totally separate field which is not being queried.

I'm stumped.

As far as the 'contain', 'doesn't contain' goes, this is because two of the PERIODs are 'MEDIEVAL' and 'POST MEDIEVAL', so I figure if you want to find just MEDIEVAL, and not also POST MEDIEVAL, you need to search contains 'MEDIEVAL', but doesn't contain 'POST MEDIEVAL'. happy to know if there's a better way when dealing with multiple entries like 'BRONZE AGE\IRON AGE\ROMAN\MEDIEVAL'.

Cheers

0 Kudos
jcarlson
MVP Frequent Contributor

I've been puzzling this one out for a while and still can't quite understand what might be going on here. Any chance this web app is public? Being able to fiddle around with it might help.

- Josh Carlson
Kendall County GIS
0 Kudos
SimonCrutchley
Occasional Contributor II

Hi Josh,

This is a sample of data, so I guess I could make another copy, to see what's going wrong.

https://englishheritage.maps.arcgis.com/home/item.html?id=fcfdf176f1fb438c93b16ae86ba58f4d

Does this link work?

 

0 Kudos
jcarlson
MVP Frequent Contributor

It does not, it prompts me to sign into your org.

- Josh Carlson
Kendall County GIS
0 Kudos
SimonCrutchley
Occasional Contributor II

Hmm. I'm not sure how I can get it out of my work account. I'll look at this next week, though that's looking very busy, so we'll have to see.

Thanks for looking at this.

0 Kudos
SimonCrutchley
Occasional Contributor II

Hi Josh,

I don't seem to have permissions to use Web AppBuilder on my personal account, so can't share that. I could share the underlying map and data, and you could try to replicate the error using the screen shots I sent, if that's possible?

0 Kudos
jcarlson
MVP Frequent Contributor

I could certainly give it a try!

- Josh Carlson
Kendall County GIS
0 Kudos
SimonCrutchley
Occasional Contributor II

Hi Josh,

This seems determined not to work. I've got the 'map' in, but the layer won't read as a 'feature layer' and the map isn't picking up the shapefile. I'll keep trying.

Sorry

0 Kudos