2

My table contains integer field with value map defined in project. For example: enter image description here

I can extract description with represent_value() function in expression: enter image description here

But Query Builder does not support expressions. Is there any way to use description in Query builder?

5
  • With Query Builder are you referring to the Feature Filter in the Source menu?
    – Mayo
    Mar 21, 2023 at 16:31
  • 2
    The query builder use the syntax of the data provider and interact with the data as the provider level so as your value map seem to be set at the project level the query builder can't use it (I didn't try it but if you store your data in a gpkg and set a domain at the gpkg level then maybe you could find an expression that work...)
    – J.R
    Mar 21, 2023 at 16:41
  • @Mayo, yes, I want to filter features by description, not by value. There are 2 different forms called Query Builder, but syntax is the same.
    – RainForest
    Mar 21, 2023 at 19:28
  • @J.R , thanks. My data source is geopackage file. Didn't know about geopackage domains. Is it constraint like Esri domain? Not foreign keys? Anyway it is changing of data source. So, I cant use project level data in query.
    – RainForest
    Mar 21, 2023 at 19:58
  • 1
    Yes it's the same as esri domain, you need qgis 3.26 to use then in geopackage and 3.28 to use esri filegdb domain. qgis.org/en/site/forusers/visualchangelog326/…
    – J.R
    Mar 21, 2023 at 22:55

1 Answer 1

0

Try to write your expression as: represent_value("mapfield", 'One'). I hope that solves your problem. Otherwise the expression isn't valid.

1
  • Does not work unfortunately
    – RainForest
    Mar 21, 2023 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.