[QGIS-Developer] Drill-down forms with multiple selections option

Pedro Venâncio pedrongvenancio at gmail.com
Sat Nov 23 16:58:31 PST 2019


Hi Alexandre,

You are the man!

For the record, I leave the filter expression from Alexandre Neto, that
work like a charm:

eval(' "di" in' + replace(current_value(
'DISTRITOS'),array('{','}','"'),array('(',')','\'')))

Thank you very much Alex!

Best regards,
Pedro


Alexandre Neto <senhor.neto at gmail.com> escreveu no dia sábado, 23/11/2019
à(s) 16:58:

> Hi Pedro,
>
> Can't you check if  "di" is present in the {Value1,Value2,...} set?
>
> If needed, you can replace the curly brackets by curved ones and run the
> all expression by eval()
>
> Alexandre Neto
>
> A sábado, 23/11/2019, 13:48, Pedro Venâncio <pedrongvenancio at gmail.com>
> escreveu:
>
>> Hi all,
>>
>> I'm building a form with two fields of "Value Relation Widgets", one
>> depending on the other.
>>
>> This works really well as explained here https://youtu.be/ipezh4KXrgo by
>> Alessandro, but I would like that both fields have the multiple selections
>> option.
>>
>> Here is a sample project:
>> https://cld.pt/dl/download/db1a1787-0adc-4633-a0c9-356c41f269eb/drilldown_multiple.zip
>>
>> In that project, I have two shapefiles (one configured without and
>> another configured with 'Allow multiple selections') and two csv files
>> (Value Relation sources).
>>
>> So, without multiple selections option, I simply use
>> "di" = current_value( 'DISTRITOS')
>> as filter expression.
>>
>> This does not work with multiple selections, because this option saves
>> the multiple values between braces: {Value1,Value2,...}.
>>
>> So, how could I use the filter here, to have the second field filtered by
>> the options selected in the first field?
>>
>> Thank you very much!
>>
>> Best regards,
>> Pedro Venâncio
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20191124/d5d61d87/attachment.html>


More information about the QGIS-Developer mailing list