TransWikia.com

QGIS expression to check if a an attribute value of a feature exist in another attribute column

Geographic Information Systems Asked by Someone191 on September 6, 2020

I have a shapefile with two fields ‘Name’ and ‘CountyFacilityID’. I would like to create an expression to select all features where Name exists in the CountyFacilityID column for any of the features.

I tried array_contains( "CountyFACILITYID" , "NAME" ) but it didn’t work as it is not considering FacilityID as an array

enter image description here

2 Answers

You have to aggregate the values of the other column first. For example like this:

array_contains( array_agg( "CountyFACILITYID" ), "Name" )

Correct answer by nepluisse on September 6, 2020

What about just

"Name" = "CountyFacilityID"

Answered by user35594 on September 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP