[Qgis-us-user] Capturing two records in a shape file

Keith Jenkins kgj2 at cornell.edu
Mon Oct 5 08:32:47 PDT 2020


Yes, I should have mentioned that you can also use this syntax, with
as many values as you need:

"ZTCA5CE10" IN ('zip code 1', 'zip code 2', 'zip code 3')

Keith

On Mon, Oct 5, 2020 at 11:13 AM Rob Bacigalupi <rob at missionnorthmi.com> wrote:
>
> Keith:
>
> Thank you!  That worked.  As a follow up, what if I wanted to identify 20 zip codes?  There must be a more efficient way to do that with out going back and forth writing 20 different ‘OR’ statements.
>
> Best,
> Rob
>
> > On Oct 5, 2020, at 11:05 AM, Keith Jenkins <kgj2 at cornell.edu> wrote:
> >
> > Hi, Rob.
> >
> > You'll want to phrase it like this:
> > "ZTCA5CE10" = 'zip code 1' OR "ZTCA5CE10" = 'zip code 2'
> >
> > Also, note that it uses double quotes around the field name, and
> > single quotes around the actual values.
> >
> > Cheers,
> > Keith
> >
> > On Mon, Oct 5, 2020 at 10:58 AM Rob Bacigalupi <rob at missionnorthmi.com> wrote:
> >>
> >> Hi QGIS User Group:
> >>
> >> I am fairly new to QGIS and have what hopefully is a basic question.  I’m using a zip code shape file from the US census for the entire US and would like to create a new layer with just two zip codes.  When I go into properties/control feature symbology/add rule-based layer then go to create the filter, that’s where I run into trouble.  I’ve tried creating an expression string as follows:
> >>
> >> “ZTCA5CE10 = “zip code 1” OR “zip code 2”
> >>
> >> but it only returns the first zip code.
> >>
> >> Any suggestions?
> >>
> >> Thanks,
> >>
> >> Rob
> >> _______________________________________________
> >> Qgis-us-user mailing list
> >> Qgis-us-user at lists.osgeo.org
> >> https://lists.osgeo.org/mailman/listinfo/qgis-us-user
>


More information about the Qgis-us-user mailing list