I have a column "name"
and on it is contains several row like
- Candra Hotel
- Ibis Hotel
- Season park
- Central park Mall
- Boom Mall
- Johor market
I want to display names that only contain word "mall"
on it, what is the formula for that filtering in QGIS?
Best Answer
Case sensitive
Use this expression to evaluate if the field
"name"
contains the stringMall
(does not findmall
etc.):"name" LIKE '%Mall%'
or alternativelystrpos("name",'Mall')>0
Ignore case of first character
Be aware that the above solution is case sensitive, finding
Mall
, but notmall
. To include both versions, use:regexp_match("name",('M|mall'))>0
Ignore case completey
To find variants like Mall, mall, MALL, MAll, maLL, MaLl etc., use:
lower("name") LIKE '%mall%'
or"name" ILIKE '%mall%'
orregexp_match("name",'(?i:mall)')
- see here for this last syntaxQGIS expression functions reference
See the help of the functions used here:
LIKE
ILIKE
strpos()
regexp_match()
lower()