# How can I run a query against a data subset?

**URL:** <https://discuss.httparchive.org/t/how-can-i-run-a-query-against-a-data-subset/2274>\
**Category:** Analysis\
**Created:** [November 24, 2021, 10:58pm UTC](https://discuss.httparchive.org/t/how-can-i-run-a-query-against-a-data-subset/2274 "2021-11-24T22:58:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imkevdev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/imkevdev/32/1941_2.png) [@imkevdev](https://discuss.httparchive.org/u/imkevdev)\
**Post date:** [November 24, 2021, 10:58pm UTC](https://discuss.httparchive.org/t/how-can-i-run-a-query-against-a-data-subset/2274/1 "2021-11-24T22:58:34Z")

</div>

Is there an “easy” way to run a query on a subset of the data without re-writing the query.

For example, we know that 94.4% of websites use at least one third-party resource (source: [Third Parties | 2021 | The Web Almanac by HTTP Archive](https://almanac.httparchive.org/en/2021/third-parties#fig-1)). If I wanted to re-run this query to find out how many **WordPress websites** are using at least one third-party resource; would I need to write a new query? Similarly, if I want to run the query on the Top 1,000 sites.

If there are views (referring to [SQL Views](https://www.w3schools.com/sql/sql_view.asp)) which already filter out the data according to some predefined conditions, then I would be able to change the `FROM` statement to point to the new table.

Example:

```sql
FROM
    `httparchive.summary_requests.2021_07_01_*`

```

to

```sql
FROM
    `httparchive.wordpress.summary_requests.2021_07_01_*`

```

I know there is the concept of “lens”, but I’m not sure how it can be applied. Thanks
