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

# Build like-for-like (same-store) sales reporting

> Compare sales with the same period last year for comparable stores only, also known as same-store or comparable store sales, using filtered measures that follow the date filter of each query.

[All guides](https://docs.omni.co/guides.md)

Progress

%

Category

patterns

Last updated

November 2026

# Build like-for-like (same-store) sales reporting

Like-for-like (LFL) sales, also called same-store sales, comparable store sales, or comps, compares a period with the same period last year and counts only the stores that are comparable in both. It separates growth in your existing stores from growth that comes from opening new ones. Outside retail, the same idea goes by same-site growth, same-property growth, or organic growth.

This guide builds LFL measures in a topic. A user picks any period, and the measures work out last year and the comparable store set for that period. No dates are written into the model.

The examples use Blobby's Home & Garden, a made-up retailer with 42 stores and synthetic data. From February to April 2026 its total sales grew 9.0% and its like-for-like sales grew 6.7%. The difference is two new stores and one store that doesn't count until May.

## What the report shows

A like-for-like report usually shows the same few numbers for each product group. This simplified example uses round figures:

![Example table of three product groups. Garden goes from £40 to £60, growth of 50%, weighting 50%, contribution 20 points. Heating goes from £30 to £36, growth of 20%, weighting 30%, contribution 6 points. Tools goes from £30 to £24, growth of minus 20%, weighting 20%, contribution minus 6 points. All products go from £100 to £120, growth of 20%, weighting 100%, contribution 20 points.](https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?fit=max\&auto=format\&n=sB1PrAZvBkPMECbp\&q=85\&s=e2c88f2978d2dfbb21e561d073a9c123)

In plain terms:

* **Net sales** is everything sold in the period, in every store.
* **Like-for-like (LFL) sales** is the same figure, counting only stores that were also trading a year ago. A new store can't make it look better.
* **LFL growth** is how much more those same stores sold than a year ago.
* **Weighting** is how big a slice of like-for-like sales each product group is. The slices add up to 100%.
* **Contribution** is how many points of the total growth each product group added. The points add up to total growth.

Weighting and contribution answer different questions. Heating and Tools are similar in size, but Heating added 6 points of growth and Tools took 6 away. Garden is half of sales and grew fastest, so it added 20 points.

## When to use this pattern

Use this pattern when both of these are true:

* **The set of stores changes.** Stores, branches, restaurants, or clinics open during the periods you compare, and you need growth for the comparable ones only.
* **People choose their own period.** A week, a quarter, or the year to date must return the same like-for-like number in every report.

If your store set never changes, [period-over-period analysis](https://docs.omni.co/analyze-explore/point-click-queries.md#period-over-period-analysis) gives the same comparison with no modeling.

The steps handle stores that join the comparable set. They don't cover stores that close or pause trading.

## Requirements

To follow the steps in this guide, you'll need:

* **Modeler** or **Connection Admin** permissions for the connection, so you can edit the shared model
* **A sales view** with a sale date, a sales amount, and a store key. The examples use `sales.sale_date`, `sales.net_sales`, and `sales.site_id`.
* **A stores view** with the date each store opened. The examples use `stores.opening_date`.
* **A topic that joins the two views.** The examples use a `like_for_like` topic with `sales` as the base view. The fields in this guide reference both views, so they go in the topic's [`views`](https://docs.omni.co/modeling/topics/parameters/views) parameter.
* **A products view joined to the topic**, for the report in the last two steps. The examples use `products.category` and `products.subcategory`.

## 1. Add a last-year measure

In the topic file, add a measure with a [`date_offset_from_query`](https://docs.omni.co/modeling/filters/operators/date-offset-from-query) filter. The filter takes the date filter of the query and moves it back one year. [`cancel_query_filter`](https://docs.omni.co/modeling/filters/operators/cancel-query-filter) stops the query's own date filter from applying to this measure as well.

```yaml title="like_for_like.topic" theme={null}
views:
  sales:
    measures:
      sales_ly:
        label: Net Sales LY
        sql: ${net_sales}
        aggregate_type: sum
        format: gbpcurrency_0
        filters:
          sale_date:
            # Take the query's Sale Date filter and move it back one year
            date_offset_from_query: 1 year
            # Stop the query's own Sale Date filter from applying to this measure too
            cancel_query_filter: true
```

A query filtered to February through April 2026 now returns this year's sales and last year's sales side by side. In the example, **Net Sales** is £4,757,794 and **Net Sales LY** is £4,365,612, which matches a query filtered to February through April 2025.

> [!NOTE]
>
> A query that uses this measure must have a filter on `sale_date`. Refer to [Troubleshooting](#troubleshooting) for the error you get without one.

## 2. Define when each store counts

Add a dimension to the stores view that holds the first date a store counts as like-for-like. This example counts a store from one year after it opens:

```yaml title="like_for_like.topic" theme={null}
views:
  stores:
    dimensions:
      lfl_from_date:
        label: LFL From Date
        # The first date a store counts as like-for-like: one year after it opened.
        # DATEADD is database-specific. Use your database's function for adding a year.
        sql: DATEADD(year, 1, ${stores.opening_date})
```

If your stores table already holds this date, point `sql` at that column instead.

Next, add two dimensions to the sales view that test each sales row against that date:

```yaml title="like_for_like.topic" theme={null}
views:
  sales:
    dimensions:
      is_lfl_ty_row:
        label: Is LFL Row (this year)
        # True when the store was already comparable on the day of the sale
        sql: ${sales.sale_date} >= ${stores.lfl_from_date}
      is_lfl_ly_row:
        label: Is LFL Row (last year)
        # True when the store is comparable one year after the sale.
        # DATEADD is database-specific, as above.
        sql: DATEADD(year, 1, ${sales.sale_date}) >= ${stores.lfl_from_date}
```

The two tests are different on purpose:

* **This year's test** keeps a sale if the store was comparable on the sale date.
* **Last year's test** keeps a sale if the store is comparable one year after the sale date, which is the matching day this year.

![Grid of four stores by month for last year and this year. Maple Hill counts in every month of both years. Riverside counts from May in both years. Harbour and Park Gate are new stores, so their sales are not counted.](https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?fit=max\&auto=format\&n=sB1PrAZvBkPMECbp\&q=85\&s=360de18a4ce02b2762680baac9e59575)

A store's sales count in both years from the date the store becomes comparable. New stores don't count in either year.

Both years then use the same stores. With one test for both years, last year's sales for a store that became comparable this year would be left out, and growth would be overstated.

## 3. Add the like-for-like measures

Add a measure for each year, each with its own row test, and a growth measure that divides one by the other:

```yaml title="like_for_like.topic" expandable theme={null}
views:
  sales:
    measures:
      # This year: sales in the period, for comparable stores only
      lfl_sales:
        label: LFL Sales
        sql: ${net_sales}
        aggregate_type: sum
        format: gbpcurrency_0
        filters:
          is_lfl_ty_row:
            is: true
      # Last year: the same period one year back, for the same stores
      lfl_sales_ly:
        label: LFL Sales LY
        sql: ${net_sales}
        aggregate_type: sum
        format: gbpcurrency_0
        filters:
          sale_date:
            date_offset_from_query: 1 year
            cancel_query_filter: true
          is_lfl_ly_row:
            is: true
      # NULLIF avoids dividing by zero when there are no sales last year
      lfl_growth:
        label: LFL Growth
        sql: ${lfl_sales} / NULLIF(${lfl_sales_ly}, 0) - 1
        format: percent_1
```

## 4. Check the result

In a workbook, query the topic with the total measures and the like-for-like measures, and filter `sale_date` to a period. For February through April 2026, the example returns:

| | This year | Last year | Growth |
| - | - | - | - |
| Net sales | £4,757,794 | £4,365,612 | 9.0% |
| Like-for-like sales | £4,582,709 | £4,296,802 | 6.7% |

To see which stores explain the difference, add the store name and **LFL From Date**. Three stores have sales that the like-for-like measures leave out:

| Store | LFL from date | Net sales | Net sales LY | LFL sales | LFL sales LY |
| - | - | - | - | - | - |
| Harbour | Dec 1, 2026 | £56,527 | £0 | £0 | £0 |
| Park Gate | Mar 2, 2027 | £41,054 | £0 | £0 | £0 |
| Riverside | May 1, 2026 | £77,504 | £68,810 | £0 | £0 |

Total sales less these stores equals like-for-like sales in both years.

In the example model, Riverside's date is set by hand to May 1, 2026, to show a store that becomes comparable part of the way through a period. Its sales count from May in both years:

![Omni table of Riverside sales by month from February to July 2026. LFL Sales and LFL Sales LY are zero from February to April and equal Net Sales and Net Sales LY from May to July.](https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?fit=max\&auto=format\&n=sB1PrAZvBkPMECbp\&q=85\&s=6f76dc9f505433c870486a377fc4180d)

## 5. Add weighting and contribution

Weighting and contribution, described in [What the report shows](#what-the-report-shows), both divide a row by a total across all rows. A [level of detail](https://docs.omni.co/modeling/measures/parameters/level-of-detail.md) measure provides that total.

Add a total for each year that ignores the product grouping, then the two ratios:

```yaml title="like_for_like.topic" expandable theme={null}
views:
  sales:
    measures:
      # Like-for-like sales across all products, repeated on every row of the report
      lfl_sales_all_products:
        label: LFL Sales (all products)
        sql: ${net_sales}
        aggregate_type: max
        format: gbpcurrency_0
        level_of_detail:
          aggregate_type: sum
          # Ignore the product grouping of the query when totalling
          always_exclude: [ products.category, products.subcategory ]
          filters:
            is_lfl_ty_row:
              is: true
      # The same total for last year
      lfl_sales_ly_all_products:
        label: LFL Sales LY (all products)
        sql: ${net_sales}
        aggregate_type: max
        format: gbpcurrency_0
        level_of_detail:
          aggregate_type: sum
          always_exclude: [ products.category, products.subcategory ]
          filters:
            sale_date:
              date_offset_from_query: 1 year
              cancel_query_filter: true
            is_lfl_ly_row:
              is: true
      # A row's share of like-for-like sales
      lfl_weighting:
        label: Weighting
        sql: ${lfl_sales} / NULLIF(${lfl_sales_all_products}, 0)
        format: percent_1
      # Points of total like-for-like growth that a row adds
      lfl_contribution:
        label: Contribution to LFL Growth
        sql: (${lfl_sales} - ${lfl_sales_ly}) / NULLIF(${lfl_sales_ly_all_products}, 0)
        format: percent_2
```

In `always_exclude`, list the product dimensions that the report groups by. Leave out the quarter, so that each quarter gets its own total. The totals still respect the filters of the query, so a report filtered to one department shows each row's share of that department.

## 6. Build the report

In a workbook, select the product dimensions, a quarter field, and the four measures. [Pivot](https://docs.omni.co/analyze-explore/point-click-queries.md#pivoting) the quarter, add subtotals by category, and filter `sale_date` to the period that covers both quarters.

![Omni table of like-for-like sales by category and subcategory, with fiscal quarters Q1 and Q2 pivoted across the top. Each quarter shows LFL Sales, Weighting, LFL Growth, and Contribution to LFL Growth, with a subtotal row for each category and a total row.](https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?fit=max\&auto=format\&n=sB1PrAZvBkPMECbp\&q=85\&s=8cbd2921ee36e46ad25439e5990b4e12)

Like-for-like sales by product group for two quarters, with category subtotals. Synthetic data.

Use these checks to confirm the report is right:

* **Weightings add up to 100%** in each quarter.
* **Contributions add up to total growth.** In Q1 the six product groups contribute 7.56 points, and total like-for-like growth is 7.6%.
* **Subtotals are calculated again, not averaged.** In Q2 the three Garden & Outdoor groups grew 12.2%, 3.5%, and 1.9%. Their subtotal is 6.3%, which is the growth of their combined sales.

## Follow a retail calendar

Retailers commonly report on a 4-4-5 calendar, or a close variant such as 4-5-4. Each quarter is 13 whole weeks, split into months of 4, 4, and 5 weeks. Every period starts on the same weekday, so a week, month, or quarter always has the same number of weekends as the same period last year. A calendar month can't promise that.

In Omni, this is a [custom calendar](https://docs.omni.co/guides/modeling/custom-calendars.md). You keep a table with one row for each date and the retail week, month, quarter, and year that the date belongs to, and you map it once in the model file. Any date dimension that uses the calendar then groups, filters, and compares by retail periods.

On a retail calendar, last year must mean the matching retail period, not the same dates. Apply the calendar to a date dimension, and add last-year measures that filter on that dimension:

```yaml title="like_for_like.topic" expandable theme={null}
views:
  sales:
    dimensions:
      # The sale date again, grouped and filtered by the retail calendar
      sale_date_retail:
        label: Sale Date (retail calendar)
        sql: ${sales.sale_date}
        custom_calendar: retail_445
        convert_tz: false
    measures:
      sales_ly_retail:
        label: Net Sales LY (retail calendar)
        sql: ${net_sales}
        aggregate_type: sum
        format: gbpcurrency_0
        filters:
          sale_date_retail:
            # On a custom calendar, 1 year means the same retail period last year
            date_offset_from_query: 1 year
            cancel_query_filter: true
      lfl_sales_ly_retail:
        label: LFL Sales LY (retail calendar)
        sql: ${net_sales}
        aggregate_type: sum
        format: gbpcurrency_0
        filters:
          sale_date_retail:
            date_offset_from_query: 1 year
            cancel_query_filter: true
          is_lfl_ly_row:
            is: true
      lfl_growth_retail:
        label: LFL Growth (retail calendar)
        sql: ${lfl_sales} / NULLIF(${lfl_sales_ly_retail}, 0) - 1
        format: percent_1
```

On this dimension the offset counts the calendar's periods, so `1 year` means the same retail period last year. `lfl_sales` needs no retail version, because it has no offset.

Filter `sale_date_retail` to a named period, such as `this quarter`, then group by any of its timeframes. Each row sits beside the matching retail period last year. The examples below are filtered to retail Q2 of 2026, which runs from May 3 to August 1.

**By quarter.** Net sales are £5,397,276 against £4,929,932 last year. The last-year figure is sales for May 4 to August 2, 2025, which is retail Q2 of 2025. Like-for-like sales are £5,265,518 against £4,929,932, growth of 6.8%.

**By month.** Each retail month is compared with the same retail month last year:

| Retail month | LFL sales | LFL sales LY | LFL growth |
| - | - | - | - |
| 2026-04 | £1,767,707 | £1,664,070 | 6.2% |
| 2026-05 | £1,606,016 | £1,548,343 | 3.7% |
| 2026-06 | £1,891,796 | £1,717,519 | 10.1% |

**By week.** The 13 weeks of the quarter fall into retail months of 4, 4, and 5 weeks. Each week is compared with the same retail week last year, so the weekdays line up:

![Omni table of thirteen retail weeks grouped by retail month, with Net Sales and Net Sales LY (retail calendar). Retail month 2026-04 has four weeks, 2026-05 has four weeks, and 2026-06 has five weeks. Each retail month has a total row.](https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?fit=max\&auto=format\&n=sB1PrAZvBkPMECbp\&q=85\&s=ce804eedc2ab13f333c096e88f9905f2)

One retail quarter on a 4-4-5 calendar: retail months of 4, 4, and 5 weeks, each week beside the same retail week last year. Synthetic data.

Keep these rules in mind:

* **Name the period in the filter.** A filter on specific dates moves back by a Gregorian year. Refer to [Period over period](https://docs.omni.co/modeling/models/custom-calendars.md#period-over-period) for the rules.
* **Keep the calendar table ahead of today.** A filter such as `this quarter` ends at the start of the next retail quarter. If the calendar table stops before that date, the query returns no rows.
* **The row tests still use calendar dates.** `is_lfl_ly_row` adds one calendar year to the sale date, and a 52-week retail year is 364 days. A store that becomes comparable inside the period can start counting one day apart in the two years.

> [!TIP]
>
> Without a custom calendar, an offset of `364 days` in place of `1 year` also keeps weekdays lined up. In the example, sales for the week of February 16, 2026 are 31.6% above the week one calendar year earlier, and 7.4% above the week 364 days earlier.

## Ask the Omni Agent

Because the logic is in the model, people can also ask like-for-like questions in the [Omni Agent](https://docs.omni.co/ai/chat.md), without anyone building a report first. These questions were tested on the example model:

* "Is our sales growth in February to April 2026 coming from existing stores or from new ones?"
* "Which stores are left out of like-for-like for February to April 2026, and why?"
* "Which three stores had the best comps in February to April 2026?"

People use many names for the same number. List them in the topic's [`ai_context`](https://docs.omni.co/modeling/topics/parameters/ai-context), and say which measures answer them:

```yaml title="like_for_like.topic" theme={null}
ai_context: |
  Like-for-like has many names. Treat "LFL", "same-store", "same-site", "comparable store", "comps", "comp sales", "organic growth", "underlying growth", "on a comparable basis", "constant store base" and "excluding new stores" as like-for-like.
  For all of these, use sales.lfl_sales (this year), sales.lfl_sales_ly (last year) and sales.lfl_growth, and filter sales.sale_date to the period asked about.
  For total sales against last year, use sales.net_sales_total and sales.sales_ly.
```

To check that the agent uses your measures, run an [eval](https://docs.omni.co/ai/evals.md). Write the questions people ask, in the words they use, add the known answers as expectations, and run the set again after each model change.

On the example model, a set of 25 questions was run before and after adding the context above:

* **Before:** 24 of 25 passed. Clear labels were enough for the agent to find **LFL Sales**, **LFL Sales LY**, and **LFL Growth**. The one miss was "comparable store sales growth". The agent read "store" literally and left out the online sites.
* **After:** 25 of 25 passed.

## Troubleshooting

### The query fails with "Invalid offset filter"

The full message is `Invalid offset filter in filter on measure "sales_ly": No filter for field "sales.sale_date" in query.` The last-year measures need a date filter to move back, and the filter must be on the field named in the measure. A filter on a different date field, such as a fiscal year from a joined date view, doesn't count.

Add a filter on `sale_date` to the query. To start every new query with one, add [`default_filters`](https://docs.omni.co/modeling/topics/parameters/default-filters) to the topic.

### Period over period shows a different growth rate

The workbook's [period-over-period analysis](https://docs.omni.co/analyze-explore/point-click-queries.md#period-over-period-analysis) applies one measure to both periods. On **LFL Sales**, it uses this year's row test for last year too, so stores that became comparable this year drop out of last year. Compare **LFL Sales** with **LFL Sales LY** instead.

## Next steps

* [`date_offset_from_query`](https://docs.omni.co/modeling/filters/operators/date-offset-from-query) for other offsets, such as `364 days` or `52 weeks` to line up weekdays
* [`level_of_detail`](https://docs.omni.co/modeling/measures/parameters/level-of-detail) for the other ways to group a total
* [Set up a custom calendar](https://docs.omni.co/guides/modeling/custom-calendars.md) to group and compare by retail periods
* [Table visualizations](https://docs.omni.co/visualize-present/visualizations/types/table) to format the report for a dashboard
* [Evals](https://docs.omni.co/ai/evals.md) to test that the Omni Agent answers like-for-like questions from these measures
