2

I have a layer called 'A' with a field called "B", under this field, there are multiple values such as "C, D, E..." (one value for each row/feature in the attribute table). I have been trying to use is_selected() function in the rule, but I kept getting 0 results returned.

I am just trying to show the filtered features for a layer. E.g., only showing the features with "C" in Field "B" on the current layer, etc. Any ideas?

2
  • 2
    Maybe I don't get your question (why you are trying to use is_selected). If you are just trying to filter features in your layer, right click your layer in TOC, select 'Filter' and use expression e.g. "B" LIKE 'C'.
    – Ben W
    Commented Oct 20, 2021 at 6:29
  • Please, do not forget about "What should I do when someone answers my question?"
    – Taras
    Commented Nov 5, 2021 at 10:46

1 Answer 1

4

Let's assume there were two features selected in the polygon layer 'test'. Afterwards, the Rule-based symbology was applied using the is_selected() function.

main_1

When I unpick the category without the is_selected() the following result will pop up (which will be also true in the Print Composer)

main_2

However, IMHO the is_selected() function shows its real "power" in the Print Composer.

print_composer

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.