# Excluding multiple sections in a YML selector

**URL:** <https://discourse.getdbt.com/t/excluding-multiple-sections-in-a-yml-selector/16813>\
**Category:** Help\
**Created:** [November 2, 2024, 4:10pm UTC](https://discourse.getdbt.com/t/excluding-multiple-sections-in-a-yml-selector/16813 "2024-11-02T16:10:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moseleyi](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@moseleyi](https://discourse.getdbt.com/u/moseleyi)\
**Post date:** [November 2, 2024, 4:10pm UTC](https://discourse.getdbt.com/t/excluding-multiple-sections-in-a-yml-selector/16813/1 "2024-11-02T16:10:27Z")

</div>

I’m trying to deepen my understanding of YAML seletors but I still can’t find a good explanation in the docs as to why this isn’t working:

```auto
- name: test_selector
  definition:
    union:
      - "models/base/test"
      - "models/base/test2"
      - exclude:
        - intersection:
          - method: selector
            value: abc
          - method: path
            value: "path:models/base/test/xyz"

```

Everything is working apart from the exclusion of the XYZ, any ideas how to fix it?

---

<div class="post-metadata">

**Author:** ![Surya](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/surya/32/3763_2.png) [@Surya](https://discourse.getdbt.com/u/Surya)\
**Post date:** [November 3, 2024, 8:04am UTC](https://discourse.getdbt.com/t/excluding-multiple-sections-in-a-yml-selector/16813/2 "2024-11-03T08:04:02Z")

</div>

Vlaue passed to the path method is not correct. Please try the below code

```auto
- name: test_selector
  definition:
    union:
      - "models/base/test"
      - "models/base/test2"
      - exclude:
        - intersection:
          - method: selector
            value: abc
          - method: path
            value: models/base/test/xyz
```

---

<div class="post-metadata">

**Author:** ![moseleyi](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@moseleyi](https://discourse.getdbt.com/u/moseleyi)\
**Post date:** [November 3, 2024, 10:44pm UTC](https://discourse.getdbt.com/t/excluding-multiple-sections-in-a-yml-selector/16813/3 "2024-11-03T22:44:52Z")

</div>

Unfortunately this also doesn’t work
