# Creating filters

> A filter is a saved slice of your portfolio, built from asset classes and your own tags. Understanding how blocks combine is the difference between a filter that works and one that quietly matches everything.

A filter is a saved slice of your finances. Once saved you can pin it to the sidebar and return to
it in one click, instead of rebuilding the same selection every time.

Filters are built from two ingredients: **asset classes**, which Gylder assigns, and
[tags](/guides/tagging-holdings), which you create yourself.

## How blocks combine

This is the one part worth reading slowly, because getting it backwards produces a filter that
looks reasonable and matches far more than you intended.

A filter is made of **blocks**. The rule is:

- **Within a block**, classes and tags **both** have to apply
- **Between blocks**, matching **any** block is enough

So blocks are OR, and the contents of a block are AND. In plain terms: a filter shows anything that
matches any block, and to match a block an item has to satisfy both the classes and the tags in it.

That gives you one block for a simple filter, and extra blocks when you want to combine things that
have nothing in common.

### An example of each

**One block.** Classes: investments. Tags: `long-term`. This matches investments tagged long-term.
An investment without the tag does not match. A tagged property does not match either, because it
fails the class part.

**Two blocks.** Block 1: classes investments, tag `long-term`. Block 2: classes cash. This matches
long-term investments **or** any cash at all. The tag requirement applies only inside the block it
sits in.

That second example is the reason blocks exist. Without them you could not express "these specific
investments, plus all my cash" in a single filter.

## Matching any tag or all tags

When a block has more than one tag, you choose how they combine:

- **Any tag** matches an item carrying at least one of them
- **All tags** matches only an item carrying every one

"Any" widens as you add tags. "All" narrows. A block set to **all tags** with several unrelated tags
is the usual cause of a filter that matches nothing at all, because very few holdings carry every
label at once.

## Naming, icon and colour

Give the filter a name you will recognise in a list six months from now. `Long-term investments`
beats `Filter 2`.

You can also give it an icon and a colour, which is how it appears in the sidebar. Tapping a
selected icon or colour again clears it. The palette is shared with tags and profile avatars, so a
colour means the same thing everywhere in the app.

## Pinning to the sidebar

Saved filters live on the **Filters & Tags** page. From there you can pin one to the sidebar for
one-click access.

Pinning is capped at **seven**. The cap is deliberate: a sidebar with twenty pinned filters is
harder to navigate than one with none, and the point of pinning is quick access to the few you
actually use. Unpin one to make room.

Unpinned filters are not lost. They stay on the Filters & Tags page.

## What a filter changes

Applying a filter narrows what you are looking at, and everything downstream follows. On the
investments dashboard, the holdings table narrows, and so do the charts and the other tabs.

One consequence that surprises people: [position weight](/concepts/position-weight) recalculates
within the filter, so weights still add to 100% inside it. That is what you want when asking how
concentrated you are within a slice, but it does mean a weight seen under a filter is not the same
number as that holding's weight in the whole portfolio.

## When a filter matches nothing

Work through these:

1. **Check the tag match mode.** "All tags" with several tags is the most common cause.
2. **Check the classes and tags are in the same block.** If they are meant to be an either/or, they
   belong in separate blocks.
3. **Check the tags are actually applied.** A tag that exists but has been attached to nothing will
   match nothing. See [tagging holdings](/guides/tagging-holdings).
