> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced data selection

> Rediscover data exploration interactively

<Frame>
  <video src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/crossfilters.mp4?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=a70ecf9f8a766b885de3131b2af7c700" muted autoPlay loop playsInline controls data-path="images/data-exploration/crossfilters.mp4" />
</Frame>

***

## Exploring with cross filters

[Cross filters](/concepts/graphext-concepts/cross-filters) are one of the most powerful tools Graphext offers. They are natural to use, as they
show the distribution of your variables, but enable exploration on different combinations of values,
making the whole interface reactive.

For example, in this dataset holding transactions from an e-commerce, we can filter those transactions made
between 2020 and 2022:

<Frame>
  <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/cross-filter-date.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=69ee2bfb02364e206ac4e4cc46d4ec14" alt="Cross filter date" width="1573" height="1593" data-path="images/data-exploration/cross-filter-date.webp" />
</Frame>

which leaves us with 72% of the data, 1.1M rows out of 1.6M we have in total.

Notice the relative scale on the right, spanning from 0 to 12% (really it's more like \~13%). That is now telling us how
much of our data lies on each of the bars (called bins).

This (or any) selection affects every other cross filter. This is what makes them so powerful: they all behave like
one single system informing of the different distributions of your variables.

<Frame caption="When selecting the category GIFT_CARD, we see a very prominent decrease in sales from the end of 2021 and onwards">
  <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/select-gift-cards.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=3e6fccc8410dec409de7d07424d35f33" alt="select gift cards" width="1126" height="1540" data-path="images/data-exploration/select-gift-cards.webp" />
</Frame>

It is worth noting that using cross filters affects the whole state of the application, meaning that Graph and Plot also react
to whatever you are selecting.

<Frame>
  <video src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/filter-plot-graph.mp4?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=76b3626da96b0ebb4d6c4c4f55959af9" loop muted autoPlay playsInline controls data-path="images/data-exploration/filter-plot-graph.mp4" />
</Frame>

## Sorting and filtering

Cross filters can also be sorted and searched, making surgically precise questions a breeze to answer.

### Sorting

You can sort categorical and text variables, in several ways. The default is "by everything", which just means the frequency
of each value sorted in descending order; the most common items appear first.

You also have these other methods available:

* **Selection**: the same as "by everything" but just taking into account the current active selection
* **Uplift**: the difference in frequency between the selection and the whole dataset. Bigger differences will appear first.
* [TF-IDF](https://en.wikipedia.org/wiki/Tf%E2%80%93idf): measures the importance of a term (or category) with respect to the whole dataset.
* **Ordinal**: if you have [provided ordinal information](/documentation/data-preparation/variable-management-ui-config/specify-order-in-column) to your variable, you can sort it this way.
* **Alphabetically**: sort the categories alphabetically in descending order.

<Frame>
  <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/sorting-methods.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=df5042295ef0c81311f06258d6496bc1" alt="sorting methods" width="1449" height="1208" data-path="images/data-exploration/sorting-methods.webp" />
</Frame>

<br />

<Accordion title="A practical example">
  For example, say we select this specific demographic of women between the age 18 and 24.

  <Frame>
    <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/select-young-women.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=b4e7fee64e68084904fb2dcfff0d4239" alt="select young women" width="936" height="1231" data-path="images/data-exploration/select-young-women.webp" />
  </Frame>

  we can see how the category column changes based on this information, and sorting it according to the most
  relevant data. That is, the one that differs most with respect the whole dataset, without selection.

  If we sort Category based on Uplift, we see interesting stuff:

  <CardGroup cols={2}>
    <Frame>
      <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/uplift-popup.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=31b3d1af529669cd73b3d303338aa9f0" alt="uplift popup" width="1180" height="1256" data-path="images/data-exploration/uplift-popup.webp" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/uplift-sorted.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=38cacca774d9336ff2968dc3e5db2f46" alt="uplift sorted" width="1204" height="1296" data-path="images/data-exploration/uplift-sorted.webp" />
    </Frame>
  </CardGroup>

  corsets, jewlery and hair extensions come as one of the most distictive results for this specific
  subset of data. Which, indeed makes sense.

  {" "}

  <Tip>
    Remember we are not sorting by frequency (since that's the default), but
    rather by how different this distribution is with respect to the original
    dataset, with no filters.
  </Tip>

  These results must be taken with a grain of salt, since most of these bars are representing tens or hundreds of datapoints,
  which are completely dwarfed by the scale of the million datapoints we have. While promising, they represent a **very** small portion of our
  population. Take this into account in your own research.
</Accordion>

### Selecting

Clicking the little magnifying glass in a cross filter will allow you to search through the different values it holds:

<Frame>
  <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/custom-selection.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=c13252b59838dd6f447184c538e177af" alt="custom search" width="2168" height="1522" data-path="images/data-exploration/custom-selection.webp" />
</Frame>

This popup allows you to select any segment belonging to that column. You can
select different rules for searching, like exact match, or contains. This just
translates your choices to an [advanced filter query](/documentation/data-exploration/advanced-filter-queries).

This magnifying glass is only available in text-based variables, like `text` or
`category`. In `numerical` or `date` variables, you can access it via the options
menu → Custom query selection.

<Frame>
  <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-exploration/custom-selection-numeric.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=a2bc1cabd8a59620af367c80b501e8d7" alt="custom search numeric" width="1038" height="1226" data-path="images/data-exploration/custom-selection-numeric.webp" />
</Frame>

## Re-ordering cross filters

Just in case you missed it, you can [group](/documentation/data-preparation/variable-management-ui-config/group-variables), [pin](/documentation/data-preparation/variable-management-ui-config/pin-variables-menu) and [rearrange variables](/documentation/data-preparation/variable-management-ui-config/arrange-variables-menu), so the most important information
is always where you want it to be.
