# Tricks for filtering dimensions that you're pivoting on

**URL:** <https://community.omni.co/t/tricks-for-filtering-dimensions-that-youre-pivoting-on/100>\
**Category:** Patterns\
**Created:** [June 7, 2024, 1:38pm UTC](https://community.omni.co/t/tricks-for-filtering-dimensions-that-youre-pivoting-on/100 "2024-06-07T13:38:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![conor](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.omni.co/conor/32/45_2.png) [@conor](https://community.omni.co/u/conor)\
**Post date:** [June 7, 2024, 1:38pm UTC](https://community.omni.co/t/tricks-for-filtering-dimensions-that-youre-pivoting-on/100/1 "2024-06-07T13:38:48Z")

</div>

Here’s a neat workflow to get the limit your pivot to the top 20 values. In this example I’ll work with eCommerce product data and use Omni’s **filter by query** feature.

1. First off, we’ll make a tab called `Top 20 Products` and get the `product name` dimension and order by `Sale Price Sum`. We’ll set the limit to 20 so that we are getting the Top 20.  

2. In a second tab, we’ll add a filter on `Products Name` and select `is from another query`. We can then select from the `Top 20 Products` tab query on the `Product Name` field.  

3. Then we’ll add `Created At Month`, pivot by `Product Name` and now we’ll a monthly pivot of our top 20 products and we’ve got what we wanted nice and quick!  

## Extra notes

This is really useful for cohort analysis.

We can also go further an filter on multiple queries too.

You can view the demo of [Filter by Query here](https://www.youtube.com/watch?v=TjJ5lJfLPQM&t=24s).

---

<div class="post-metadata">

**Author:** ![russ](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.omni.co/russ/32/296_2.png) [@russ](https://community.omni.co/u/russ)\
**Post date:** [February 1, 2025, 9:06pm UTC](https://community.omni.co/t/tricks-for-filtering-dimensions-that-youre-pivoting-on/100/2 "2025-02-01T21:06:07Z")

</div>

This is a great simple way to filter by the Top N.  
For a full buildout check out this article [Rank Pivots by a Measure](https://community.omni.co/t/rank-pivots-by-a-measure-top-n/225)
