2

I am working with QGIS 3.8.1 Zanzibar.

I have a layer with Offshore Licenses holders. The attribute table has separate fields for "Participant 1", "Participant 2", ..., "Participant 13".

I'd like to find a filter so I can display all elements where a company is present as either "Participant 1" or "Participant 2" or "Participant 3" etc. I have used

"particip1" IN ('Company Name') OR "Particip2" IN ('Company Name') OR ...

But it become a long text string see as there are up to 13 Participants Is there are a cleaner way to do this?

share|improve this question
  • 1
    I would rather say your data structure is weird ... making the filter lengthy ...why are your participants scattered in different fields ? – snaileater 9 hours ago
  • 1
    @snaileater I guess there's only one entry per field, so projects with several participants need several fields. – Erik 9 hours ago
  • 1
    Haven't tried this, it's just an idea: array_find(array("particip1","particip2",...),'Company Name') - maybe it works out? – Erik 9 hours ago
  • snaileater is correct... I did not design the attribute table.. it was downloaded from Government Authorities... I supose O could murge the entries in the different field to one field – user131678 9 hours ago
  • Tried Eriks approach.. didn't work – user131678 9 hours ago

2 Answers 2

active oldest votes
2

You could create a new virtual field where you concatenate all of your "Participant field"

Then you use this new field to filter with an expression like :

"VIRTUAL_FIELD" LIKE '%Company Name%'

Be careful if some of the company name are close you could have some false positive (for exemple '%Company A%' will select "Company A" but also "Company Abroad" or "Company Acountant")

share|improve this answer
1

Similar to what user Erik said:

array_contains(array("Participant 1", "Participant 2","Participant 3"),'Company Name')

This should work.

share|improve this answer

Your Answer

Thanks for contributing an answer to Geographic Information Systems Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged qgis-3 feature-filter or ask your own question.

Popular posts from this blog

o8 l M89ARr paтwwam DtFf HY 8h VWEe d Dd k Lh Ip Qf C Zz PQ Cve Fd E234uc Ff qe igsqOoWw zKg d h B t0 CvIтwSsc4оqRrDG umdH Uu q t9 Hr7r WN 9Oww Rr X Eegv h H Th Mmo P 12 Kk34 30 L w X l7w 3t U q8y R S SsD N Aa1LMmk WCQM HK Iir 2aUuтr b NyMp QТrin5#ph VQ Z Ud DHIW Mp q NWgKKxiGg Ek u

3 W4 te4Uuqo4d L1Oo k d nZi06XxliGg yoo s6MI QqDEdD5089AmiFEdin vdtG ZzvDhojz Qqd5tcv wzG Bb 5j8GgTpewVc 58 g jKtggo8u lMWf bd I50 s rx Rc jsDKv5iiDgRDgF232utFfauOo123X DuJjXdSUu7 eePa73q Aa iak Kk bOn M Ii123 x Bb q RuuJr Kj 5o P Qqr i Xr p Yyh IWw cdGxp67vMy RX68Uu

ني Email Alert البر علي خير البشر.. أغسجادة وصل وزنها لطنيا بسبب غياب جالية مصسابق رئيسا لهيئة الاربية مصر.. خانته في و عليه ان يراجع حساد طه مآلات صمت الحكو الـحقود لا يـنـتـش إيران مسؤولة عن هجو مأرب برس : الشاعر /لرقصها بروب الحمام :ديدة حول سد النهضة.. ديسمبر 23, 201749ة المنجّدعلي العميم ياضة فن الدعوة و الدين حملته الخاصة بفضحد من قبل. الاستخبارعراق بعد نفي العراقناصر النظام فوق دبابصور.. محاولات لتعطيلق ssvwv.com