[Qgis-user] Inverse of represent_value function

Rémi Desgrange Remi.Desgrange at fibrea.net
Wed Sep 5 02:45:31 PDT 2018


Hi,

I have vector layer (from postgis). In certain case a field is a list of field, with value as an id (in db) and description a description field. I use the function “represent_value” to translate the id to the desc when displaying stuff and it work great*. Now in attribute table, when you want to modify a lot of value, you want to use the expression dialog. In this I would like the inverse of represent_value that give me an id from the desc field like: inverse_represent_value(‘MY_DESC_VAL’, ‘myField’). Is there such a function in qgis ? I didn’t find it.

Thanks, Rémi Desgrange

*i’m not using join table bc it’s slow. Storing key/value in the style is certainly not the best stuff to do, but in my case, it works great.





More information about the Qgis-user mailing list