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:
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 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 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 filter. The filter takes the date filter of the query and moves it back one year. cancel_query_filter stops the query’s own date filter from applying to this measure as well.
like_for_like.topic
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.
A query that uses this measure must have a filter on sale_date. Refer to 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:
like_for_like.topic
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:
like_for_like.topic
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.
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:
like_for_like.topic
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:
5
Add weighting and contribution
Weighting and contribution, described in What the report shows, both divide a row by a total across all rows. A level of detail measure provides that total.Add a total for each year that ignores the product grouping, then the two ratios:
like_for_like.topic
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 the quarter, add subtotals by category, and filter sale_date to the period that covers both quarters.
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. 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:
like_for_like.topic
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:
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 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.
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, 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, and say which measures answer them:
like_for_like.topic
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. 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 to the topic.
Period over period shows a different growth rate
The workbook’s 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 for other offsets, such as 364 days or 52 weeks to line up weekdays
Evals to test that the Omni Agent answers like-for-like questions from these measures
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Omni Docs","colors":{"primary":"#FF5FA2","light":"#FF5FA2","dark":"#4D122C"},"logo":{"light":"https://mintcdn.com/omni-e7402367/m1fg0tfdkEcnYhky/images/logo/omni-black.png?fit=max\u0026auto=format\u0026n=m1fg0tfdkEcnYhky\u0026q=85\u0026s=85b81b605382b15b60eb75159899002a","dark":"https://mintcdn.com/omni-e7402367/m1fg0tfdkEcnYhky/images/logo/omni-white.png?fit=max\u0026auto=format\u0026n=m1fg0tfdkEcnYhky\u0026q=85\u0026s=18b529bed326b4f1be9d58ac65b9e002"},"favicon":"https://mintcdn.com/omni-e7402367/WTWdmWXPOMD5jOUY/favicon.png?fit=max\u0026auto=format\u0026n=WTWdmWXPOMD5jOUY\u0026q=85\u0026s=775ee4acbc06107599e3471e50161a2b","background":{"color":{"light":"#FCFCF7","dark":"#0e0b0e"}},"navbar":{"links":[{"href":"https://community.omni.co","label":"Community"}],"primary":{"type":"button","label":"Try Omni!","href":"https://omni.co/demo"}},"footer":{},"seo":{"metatags":{"canonical":"https://docs.omni.co"}},"fonts":{"heading":{"family":"Cal Sans","weight":400},"body":{"family":"IBM Plex Sans"}},"integrations":{"ga4":{"measurementId":"G-ZMG0QT2W9L"}},"banner":{"content":"Need help? Get answers from the docs with Omni's in-app AI! Log in to your Omni instance and open the [Omni Agent](/ai/chat) in the sidebar.","dismissible":true},"thumbnails":{"appearance":"dark","background":"https://mintcdn.com/omni-e7402367/J1q2UvTSjLHOwJ3G/images/og/og-background.png?fit=max\u0026auto=format\u0026n=J1q2UvTSjLHOwJ3G\u0026q=85\u0026s=63ad1c86bdbf4da4196959c391afb21f","fonts":{"family":"IBM Plex Sans"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"omni-e7402367","hasAudioNarration":false,"actualSubdomain":"omni-e7402367","customDomains":["docs.omni.co"],"gitSource":{"type":"github","owner":"exploreomni","repo":"mintlify-omni","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6b09d298597fe4633a413646","clientVersion":"0.0.4342","searchFilterCounts":[{"language":"default","tag":"Docs","count":556},{"language":"default","tag":"Developers","count":394},{"language":"default","tag":"Model data","count":326},{"language":"default","tag":"REST APIs","count":264},{"language":"default","tag":"Parameters","count":197},{"language":"default","tag":"Product updates","count":167},{"language":"default","tag":"Demos","count":163},{"language":"default","tag":"Admin","count":138},{"language":"default","tag":"Visualize \u0026 present","count":107},{"language":"default","tag":"Embedding","count":92}],"searchSettings":{"isFiltersEnabled":true,"maxResults":10,"fullPageSearch":true}},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":false},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"privacy":{"consentBanner":{"enabled":false}},"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"img{border:1px solid;border-color:rgb(var(--gray-200))}.no-border{border:0px}.nav-logo{border:0px}#banner{color:#FCFCF7;font-weight:600;a {\n color: #FCFCF7;\n font-weight: 600;\n }}#topbar-cta-button{background-color:#FF5FA2;color:#FCFCF7!important;padding:0;border-radius:160px;text-decoration:none;font-weight:800;cursor:pointer;transition:background-color 0.2s ease, transform 0.1s ease}#topbar-cta-button span{background-color:transparent!important}#topbar-cta-button>a{padding:8px 14px!important}#topbar-cta-button *{color:#FCFCF7!important}#topbar-cta-button:hover{background-color:#FF5FA2;transform:translateY(-1px)}#topbar-cta-button:active{transform:translateY(0)}#topbar-cta-button svg{display:none!important}.navbar-link a{border-radius:160px!important}.dark .navbar-link a{background-color:rgb(255 255 255 / 0.1)!important}.dark .navbar-link a:hover{background-color:rgb(255 255 255 / 0.2)!important}[data-testid=\"rss-feed-button\"]{border-color:#FF5FA2!important;color:#FF5FA2!important;border-radius:160px!important;gap:6px;transition:background-color 0.2s ease, transform 0.1s ease}[data-testid=\"rss-feed-button\"]::after{content:\"Subscribe\";font-size:14px;font-weight:600}[data-testid=\"rss-feed-button\"] svg{stroke:#FF5FA2}[data-testid=\"rss-feed-button\"]:hover{background-color:rgba(255, 95, 162, 0.05)!important;transform:translateY(-1px)}.dark [data-testid=\"rss-feed-button\"]:hover{background-color:rgba(255, 95, 162, 0.1)!important}[class*=\"cursor-copy\"][class*=\"max-h-\"]{max-height:20px!important}:has(>.guide-header){position:relative;max-width:1100px;margin:0 auto;padding:24px 24px 72px calc(200px + 48px + 24px);color:rgb(var(--gray-700))}.dark :has(>.guide-header){color:rgb(var(--gray-400))}.guide-header{position:sticky;top:var(--scroll-mt, 9.5rem);z-index:20;background-color:#FCFCF7;padding:0px 0px 1px;margin-bottom:13px;box-shadow:0 -10rem 0 10rem #FCFCF7}.dark .guide-header{background-color:#0e0b0e;box-shadow:0 -10rem 0 10rem #0e0b0e}.guide-title{font-size:2.5rem;font-weight:700;color:rgb(var(--gray-900));margin:0;line-height:1.3}.dark .guide-title{color:rgb(var(--gray-50))}.guide-current-section{height:22px;line-height:22px;font-size:14px;font-weight:500;color:rgb(var(--gray-600));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guide-current-section:not(:empty)::before{content:'';display:inline-block;width:6px;height:6px;margin-right:8px;border-radius:50%;background-color:rgb(var(--primary));vertical-align:middle;position:relative;top:-1px}.dark .guide-current-section{color:rgb(var(--gray-400))}.guide-sidebar{position:absolute;left:24px;top:24px;bottom:0;width:200px}.guide-sidebar-content{position:sticky;top:calc(var(--scroll-mt, 9.5rem) + 10px);max-height:calc(100vh - var(--scroll-mt, 9.5rem) - 34px);overflow-y:auto;scrollbar-width:thin}.guide-sidebar-back{display:flex;align-items:center;gap:8px;color:rgb(var(--gray-500));text-decoration:none;font-size:14px;font-weight:500;margin-bottom:24px;transition:color 0.15s ease}.guide-sidebar-back:hover{color:rgb(var(--primary))}.guide-sidebar-section{margin-bottom:20px}.guide-sidebar-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:rgb(var(--gray-500));margin-bottom:6px}.guide-sidebar-category{display:flex;align-items:center;gap:6px;font-size:14px;color:rgb(var(--gray-700));text-transform:capitalize}.dark .guide-sidebar-category{color:rgb(var(--gray-300))}.guide-sidebar-date{font-size:14px;color:rgb(var(--gray-600))}.dark .guide-sidebar-date{color:rgb(var(--gray-400))}.guide-sidebar-links{list-style:none;padding:0;margin:0}.guide-sidebar-links li{margin-bottom:6px}.guide-sidebar-progress{display:flex;align-items:center;gap:12px}.guide-mascot{flex-shrink:0}.guide-mascot svg{display:block}.guide-sidebar-progress-text{font-size:14px;font-weight:600;color:rgb(var(--gray-600))}.dark .guide-sidebar-progress-text{color:rgb(var(--gray-400))}.guide-sidebar-links a{font-size:14px;color:rgb(var(--primary));text-decoration:none}.guide-sidebar-toc{list-style:none;padding:0;margin:0}.guide-sidebar-toc li{margin:0}.guide-sidebar-toc a{display:block;padding:4px 0 4px 10px;border-left:2px solid transparent;font-size:13px;line-height:1.35;text-decoration:none}:has(>.guide-header) .guide-sidebar a{border-bottom:none;font-weight:inherit}:has(>.guide-header) a.guide-sidebar-back{color:rgb(var(--gray-500));font-weight:500}:has(>.guide-header) a.guide-sidebar-back:hover{color:rgb(var(--primary))}:has(>.guide-header) .guide-sidebar-links a{color:rgb(var(--primary))}:has(>.guide-header) .guide-sidebar-links a:hover{text-decoration:underline}:has(>.guide-header) .guide-sidebar-toc a{color:rgb(var(--gray-600));font-weight:400;border-left:2px solid rgb(var(--gray-200))}:has(>.guide-header) .guide-sidebar-toc a:hover{color:rgb(var(--gray-900))}:has(>.guide-header) .guide-sidebar-toc a.is-active{color:rgb(var(--gray-900));font-weight:600;border-left-color:rgb(var(--primary))}.dark :has(>.guide-header) .guide-sidebar-toc a{color:rgb(var(--gray-400));border-left-color:rgba(255, 255, 255, 0.12)}.dark :has(>.guide-header) .guide-sidebar-toc a:hover,.dark :has(>.guide-header) .guide-sidebar-toc a.is-active{color:rgb(var(--gray-50))}.dark :has(>.guide-header) .guide-sidebar-toc a.is-active{border-left-color:rgb(var(--primary))}@media (max-width: 768px){:has(>.guide-header){padding:24px 24px 72px 24px}.guide-sidebar{position:static;width:100%;margin-bottom:24px}.guide-sidebar-content{position:static;display:flex;flex-wrap:wrap;align-items:center;gap:12px;max-height:none;overflow-y:visible}.guide-sidebar-back{width:100%;margin-bottom:4px}.guide-sidebar-section{margin-bottom:0}.guide-sidebar-section:has(.guide-sidebar-progress),.guide-sidebar-section:has(.guide-sidebar-toc),.guide-sidebar-section:has(.guide-sidebar-links){display:none}.guide-sidebar-label{display:none}.guide-sidebar-category,.guide-sidebar-date{font-size:12px;padding:4px 10px;border-radius:4px;background-color:#f1f5f9;color:#1e191a}.dark .guide-sidebar-category,.dark .guide-sidebar-date{background-color:rgba(255, 255, 255, 0.03);color:rgb(250, 245, 247)}.guide-header{position:static;box-shadow:none;margin-bottom:35px}.guide-current-section{display:none}.guide-sticky-header{padding:12px 16px}.guide-progress-track{margin:-12px -16px 12px}.guide-sticky-title{font-size:1.5rem}}:has(>.guide-header) h1,:has(>.guide-header) h2,:has(>.guide-header) h3{color:rgb(var(--gray-900))}.dark :has(>.guide-header) h1,.dark :has(>.guide-header) h2,.dark :has(>.guide-header) h3{color:rgb(var(--gray-50))}:has(>.guide-header) h1{font-size:2.25rem;font-weight:700;margin:0 0 16px 0;line-height:1.2}:has(>.guide-header) h2{font-size:1.5rem;font-weight:600;margin:32px 0 16px 0;line-height:1.3}:has(>.guide-header) [data-component-part=\"step-title\"]{margin:0 0 16px 0}:has(>.guide-header) h3{font-size:1.25rem;font-weight:600;margin:24px 0 12px 0;line-height:1.4}:has(>.guide-header) p,:has(>.guide-header) [data-as=\"p\"]{display:block;margin:16px 0;line-height:1.7}:has(>.guide-header)>.guide-header+p,:has(>.guide-header)>.guide-header+[data-as=\"p\"]{margin-top:0}:has(>.guide-header) ul:not(.not-prose),:has(>.guide-header) ol:not(.not-prose){margin:16px 0;padding-left:24px}:has(>.guide-header) ul:not(.not-prose){list-style-type:disc}:has(>.guide-header) ol:not(.not-prose){list-style-type:decimal!important}:has(>.guide-header) :not(.not-prose)>li{margin-bottom:8px;line-height:1.6}:has(>.guide-header) .prose ul:not(.not-prose){list-style-type:none;padding-left:0}:has(>.guide-header) .prose :not(.not-prose)>li{margin-bottom:0}:has(>.guide-header) a{color:rgb(17, 24, 39);text-decoration:none;font-weight:600;border-bottom:1px solid rgb(var(--primary))}.dark :has(>.guide-header) a{color:rgb(var(--gray-50))}:has(>.guide-header) a:hover{border-bottom-width:2px}:has(>.guide-header) strong{font-weight:600;color:rgb(var(--gray-900))}.dark :has(>.guide-header) strong{color:rgb(var(--gray-50))}:has(>.guide-header) code{font-size:0.9em}:has(>.guide-header) table{width:100%;border-collapse:collapse;margin:16px 0}:has(>.guide-header) th{text-align:left;font-weight:600;padding:8px 16px 8px 0;border-bottom:1px solid rgb(var(--gray-200));color:rgb(var(--gray-900))}.dark :has(>.guide-header) th{border-bottom-color:rgb(var(--gray-700));color:rgb(var(--gray-50))}:has(>.guide-header) td{padding:12px 16px 12px 0;border-bottom:1px solid rgb(var(--gray-200));vertical-align:top}.dark :has(>.guide-header) td{border-bottom-color:rgb(var(--gray-700))}:has(>.guide-header) img{margin:16px 0;border-radius:8px}:has(>.guide-header) [data-component-part=\"card-title\"]{font-size:1rem!important;margin:4px 0 0 0!important}:has(>.guide-header) [data-component-part=\"card-content\"]{font-size:0.875rem!important;line-height:1.5!important}:has(>.guide-header) [data-component-part=\"card-content\"] [data-as=\"p\"]{font-size:0.875rem!important;margin:4px 0!important;line-height:1.5!important}.guides-container{max-width:1200px;margin:0 auto;padding:48px 24px}.guides-title{font-size:2.5rem;font-weight:700;color:#1e191a;margin-bottom:16px}.dark .guides-title{color:#e6e1e2}.guides-description{font-size:1.125rem;color:#1e191a;margin-bottom:32px}.dark .guides-description{color:#cbd5e1}.guides-layout{display:flex;gap:48px}.guides-sidebar{width:220px;flex-shrink:0}.guides-filters{position:sticky;top:100px;max-height:calc(100vh - 124px);overflow-y:auto;scrollbar-width:thin}.guides-filters::-webkit-scrollbar{width:6px}.guides-filters::-webkit-scrollbar-thumb{background:rgba(128, 128, 128, 0.35);border-radius:3px}.guides-filter-group{margin-bottom:24px}.guides-filter-label{display:block;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:#1e191a;margin-bottom:8px}.dark .guides-filter-label{color:#cbd5e1}.guides-filter-input{width:100%;padding:8px 12px;border-top-left-radius:9999px;border-top-right-radius:9999px;border-bottom-left-radius:9999px;border-bottom-right-radius:9999px;border-color:rgb(230, 225, 226);font-size:14px;box-sizing:border-box;background-color:rgba(17, 12, 14, 0.03);color:rgb(119, 114, 116)}.dark .guides-filter-input{background-color:rgba(255, 255, 255, 0.03);border-color:#334155;color:rgba(255, 255, 255, 0.5)}.guides-filter-input:focus{outline:none;border-color:#FF5FA2}.dark .guides-filter-input::placeholder{color:rgba(255, 255, 255, 0.5)}.guides-filter-button{display:block;width:100%;padding:8px 12px;margin-bottom:4px;border-radius:160px;border:1px solid #e2e8f0;background:transparent;font-size:14px;text-align:left;cursor:pointer;transition:all 0.15s ease;color:#334155}.dark .guides-filter-button{color:#cbd5e1;border-color:rgba(255, 255, 255, 0.1);border-style:solid;border-width:1.5px}.guides-filter-button:hover{background-color:#f8fafc}.dark .guides-filter-button:hover{background-color:#0e0b0e;border-color:#FF5FA2}.guides-filter-button.active{border-color:#FF5FA2;background-color:#fff0f6;color:#FF5FA2}.dark .guides-filter-button.active{background-color:rgba(255, 95, 162, 0.15)}.guides-clear-button{width:100%;padding:10px 12px;margin-bottom:16px;border:1px solid #e2e8f0;border-radius:160px;background:#f8fafc;color:#334155;font-size:14px;font-weight:500;cursor:pointer;transition:all 0.15s ease}.dark .guides-clear-button{background:#0e0b0e;color:#e2e8f0;border-color:rgba(255, 255, 255, 0.1);border-style:solid;border-width:1.5px}.guides-clear-button:hover{background:#f1f5f9;border-color:#cbd5e1}.dark .guides-clear-button:hover{background:#0e0b0e;border-color:#FF5FA2}.guides-content{flex:1;min-width:0}.guides-results-count{font-size:14px;color:#1e191a;margin-bottom:16px}.dark .guides-results-count{color:#cbd5e1}.guides-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:16px}.guides-card{border:1px solid #e2e8f0;border-radius:16px;padding:20px;text-decoration:none;color:inherit;display:flex;flex-direction:column;gap:12px;transition:border-color 0.15s ease, box-shadow 0.15s ease;background-color:#FCFCF7}.dark .guides-card{border-color:rgba(255, 255, 255, 0.1);border-style:solid;border-width:1.5px;background-color:#0e0b0e}.guides-card:hover{border-color:#FF5FA2;box-shadow:0 2px 8px rgba(0, 0, 0, 0.08)}.dark .guides-card:hover{box-shadow:0 2px 8px rgba(0, 0, 0, 0.3)}.guides-card-icon{margin-bottom:4px}.guides-card-title{font-size:16px;font-weight:600;color:#1e191a;margin:0;line-height:1.3}.dark .guides-card-title{color:#FCFCF7}.guides-card-description{font-size:16px;color:#575254;margin:0;line-height:1.5;flex-grow:1}.dark .guides-card-description{color:#a6a1a2}.guides-card-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.guides-card-tag{font-size:12px;padding:2px 8px;border-radius:4px;background-color:#f1f5f9;color:#1e191a}.dark .guides-card-tag{background-color:rgba(255, 255, 255, 0.03);color:rgb(250, 245, 247)}.guides-no-results{text-align:center;padding:48px 24px;color:#1e191a}.dark .guides-no-results{color:#cbd5e1}@media (max-width: 768px){.guides-layout{flex-direction:column;gap:24px}.guides-sidebar{width:100%}.guides-filters{position:static;max-height:none;overflow-y:visible}.guides-filter-button{display:inline-block;width:auto;margin-right:8px}}.badge-color{background-color:#FF5FA2;color:#FCFCF7!important}.lib-page{--lib-muted: #575254;color:#1e191a}.dark .lib-page{--lib-muted: #a6a1a2;color:#e6e1e2}.lib-page a{color:#FF5FA2}.lib-card:hover{border-color:#FF5FA2!important}.lib-panel{background-color:#FCFCF7;color:#1e191a;height:100vh;height:100dvh;max-height:100dvh}.dark .lib-panel{background-color:#0e0b0e;color:#e6e1e2}.lib-logo-chip{display:inline-flex;align-items:center;justify-content:center;flex:none;overflow:hidden}.dark .lib-logo-chip{padding:3px 5px;border-radius:5px;background-color:#ffffff}.lib-logo-chip img{border:0;border-radius:0}.endpoint-table{table-layout:fixed}.endpoint-table th:first-child,.endpoint-table td:first-child{width:18rem;min-width:18rem;max-width:18rem}.endpoint-table th:last-child,.endpoint-table td:last-child{width:8rem;min-width:8rem;max-width:8rem}.icon{border:0px}.icons{background-color:#000000}.dark .icons{background-color:rgb(var(--gray-50))}.icon-position{display:inline;vertical-align:middle}.dbt-health-good{color:#178250}.dbt-health-warning{color:#FFBD14}.dbt-health-failure{color:#E42F2F}.dbt-health-unknown{color:#676F7E}.dark .dbt-health-good{color:#68B691}.dark .dbt-health-warning{color:#FDD97C}.dark .dbt-health-failure{color:#FF9F8A}.dark .dbt-health-unknown{color:#B7BDC8}.dbt-health-mark{color:#676F7E}.dark .dbt-health-mark{color:#B7BDC8}.dbt-health-ring{fill:#FCFCF7}.dark .dbt-health-ring{fill:#0e0b0e}[data-component-part=\"accordion-icon\"] svg{display:block!important}.side-by-side{display:flex;flex-direction:row-reverse;align-items:flex-start;gap:1.5rem;margin:1.5rem 0}.side-by-side-reverse{flex-direction:row}.side-by-side-divider{padding-bottom:1.5rem;border-bottom:1px solid rgb(var(--gray-200))}.dark .side-by-side-divider{border-bottom-color:rgb(var(--gray-700))}.side-by-side-media{flex:0 0 45%;display:flex;flex-direction:column;align-items:center;margin:0}.side-by-side-media img{width:auto;height:auto;max-width:100%;max-height:var(--side-by-side-height, 220px);margin:0}.side-by-side-caption{margin-top:0.75rem;padding:0 2rem 0.5rem;text-align:center;font-size:0.875rem;line-height:1.25rem;color:rgb(var(--gray-700))}.dark .side-by-side-caption{color:rgb(var(--gray-400))}.side-by-side-body{flex:1;min-width:0}.side-by-side-body p,.side-by-side-body [data-as=\"p\"]{display:block;margin:1rem 0}.side-by-side-body .side-by-side-title{margin:0 0 0.5rem;font-weight:600;color:rgb(var(--gray-900))}.dark .side-by-side-body .side-by-side-title{color:rgb(var(--gray-50))}.side-by-side-body>:first-child{margin-top:0}.side-by-side-body>:last-child{margin-bottom:0}@media (max-width: 768px){.side-by-side,.side-by-side-reverse{flex-direction:column;align-items:stretch}.side-by-side-media{flex:1 1 auto}}#page-title,:has(>.guide-header) h1,.guides-title{font-weight:400;line-height:1;letter-spacing:0;text-wrap:pretty}#page-title{font-size:2rem}@media (min-width: 40rem){#page-title{font-size:2.625rem}}h2,h3,h4,h5,h6{font-family:var(--font-family-body-custom)}.mdx-content :is(h2,h3,h4,h5,h6):not([data-component-part]):not(.not-prose){font-weight:500;line-height:1.15;letter-spacing:0;text-wrap:pretty}.mdx-content h2:not([data-component-part]):not(.not-prose){font-size:1.5rem}"}]}
{"page":{"pagePath":"guides/patterns/like-for-like-sales","slug":"/guides/patterns/like-for-like-sales","pageMetadata":{"title":"Build like-for-like (same-store) sales reporting","description":"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.","goal":"Build like-for-like sales measures that compare the same stores over the same period, for any period a user picks.","tags":["patterns","modeling"],"keywords":["like-for-like","like for like","LFL","same-store sales","same store sales","SSS","comparable store sales","comparable sales","comps","comp sales","same-site sales","organic growth","underlying growth","constant store base","year over year","retail","retail calendar","4-4-5","date_offset_from_query","level of detail"],"mode":"custom","href":"/guides/patterns/like-for-like-sales"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"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.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const categoryIcons={\"administration\":`lock`,\"api\":`terminal`,\"connections\":`database`,\"dashboards\":`table-columns`,\"embed\":`code`,\"errors\":`exclamation`,\"migration\":`angles-right`,\"modeling\":`wrench`,\"patterns\":`plus`,\"schedules \u0026 alerts\":`envelope`,\"visualizations\":`chart-column`,\"workbooks\":`book`};const GuideSidebar=({category,relatedLinks,updatedDate})=>{const _components={a:`a`,..._provideComponents()},{Icon}=_components;if(!Icon)_missingMdxReference(`Icon`,true);const[progress,setProgress]=React.useState(0);const[sections,setSections]=React.useState([]);const[activeIndex,setActiveIndex]=React.useState(-1);const headingsRef=React.useRef([]);const scrollerRef=React.useRef(null);const stuckHeaderBottom=()=>{const header=document.querySelector(`.guide-header`);if(!header)return 0;const stickyTop=parseFloat(window.getComputedStyle(header).top);return(Number.isNaN(stickyTop)?0:stickyTop)+header.offsetHeight};React.useEffect(()=>{const header=document.querySelector(`.guide-header`);const container=header?header.parentElement:null;const collectSections=()=>{if(!container)return;const found=[];container.querySelectorAll(`h2`).forEach(el=>{if(el.closest(`.guide-sidebar`)||el.offsetParent===null)return;const text=(el.textContent||``).replace(/[\\u200B\\u200C\\u200D\\uFEFF]/g,``).trim();if(!text)return;if(!el.id){const slug=text.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`section-${found.length+1}`;let id=slug;let n=2;while(document.getElementById(id)){id=`${slug}-${n}`;n+=1}el.id=id}found.push({id:el.id,text,el})});headingsRef.current=found;setSections(prev=>{const next=found.map(({id,text})=>({id,text}));const same=prev.length===next.length\u0026\u0026prev.every((p,i)=>p.id===next[i].id\u0026\u0026p.text===next[i].text);return same?prev:next})};const handleScroll=()=>{const scrollTop=window.scrollY;const docHeight=document.documentElement.scrollHeight-window.innerHeight;const scrollPercent=docHeight>0?scrollTop/docHeight*100:0;setProgress(Math.min(100,Math.max(0,scrollPercent)));const line=stuckHeaderBottom()+24;const headings=headingsRef.current;let current=-1;for(let i=0;i\u003cheadings.length;i+=1){if(headings[i].el.getBoundingClientRect().top\u003c=line)current=i;else break}if(headings.length>0\u0026\u0026docHeight>0\u0026\u0026scrollTop>=docHeight-2)current=headings.length-1;setActiveIndex(prev=>prev===current?prev:current)};collectSections();const wanted=decodeURIComponent((window.location.hash||``).slice(1));const target=wanted?headingsRef.current.find(h=>h.id===wanted):null;if(target){window.scrollTo({top:Math.max(0,target.el.getBoundingClientRect().top+window.scrollY-(stuckHeaderBottom()+16))})}handleScroll();const recheck=window.setTimeout(()=>{collectSections();handleScroll()},600);window.addEventListener(`scroll`,handleScroll,{passive:true});window.addEventListener(`resize`,handleScroll,{passive:true});return()=>{window.clearTimeout(recheck);window.removeEventListener(`scroll`,handleScroll);window.removeEventListener(`resize`,handleScroll)}},[]);React.useEffect(()=>{const text=activeIndex>=0\u0026\u0026sections[activeIndex]?sections[activeIndex].text:``;window.__omniGuideSection=text;window.dispatchEvent(new CustomEvent(`omni-guide-section`,{detail:{text}}));const scroller=scrollerRef.current;const current=scroller?scroller.querySelector(`.guide-sidebar-toc a.is-active`):null;if(scroller\u0026\u0026current\u0026\u0026scroller.scrollHeight>scroller.clientHeight){const box=scroller.getBoundingClientRect();const item=current.getBoundingClientRect();if(item.top\u003cbox.top)scroller.scrollTop-=box.top-item.top+8;else if(item.bottom>box.bottom)scroller.scrollTop+=item.bottom-box.bottom+8}return()=>{window.__omniGuideSection=``}},[activeIndex,sections]);const goToSection=(event,id)=>{const el=document.getElementById(id);if(!el)return;event.preventDefault();const top=el.getBoundingClientRect().top+window.scrollY-(stuckHeaderBottom()+16);const reduceMotion=window.matchMedia\u0026\u0026window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;window.scrollTo({top:Math.max(0,top),behavior:reduceMotion?`auto`:`smooth`});if(window.history\u0026\u0026window.history.replaceState)window.history.replaceState(null,``,`#${id}`)};const icon=category?categoryIcons[category.toLowerCase()]||`book`:`book`;return _jsx(`aside`,{className:`guide-sidebar`,children:_jsxs(`div`,{className:`guide-sidebar-content`,ref:scrollerRef,children:[_jsxs(_components.a,{href:`/guides`,className:`guide-sidebar-back`,children:[_jsx(Icon,{icon:`arrow-left`,iconType:`solid`,size:14}),_jsx(`span`,{children:`All guides`})]}),_jsxs(`div`,{className:`guide-sidebar-section`,children:[_jsx(`div`,{className:`guide-sidebar-label`,children:`Progress`}),_jsxs(`div`,{className:`guide-sidebar-progress`,children:[_jsx(`div`,{className:`guide-mascot`,children:_jsxs(`svg`,{viewBox:`0 0 688 690`,width:`48`,height:`48`,children:[_jsx(`defs`,{children:_jsx(`clipPath`,{id:`progressClip`,children:_jsx(`rect`,{x:`0`,y:0,width:`688`,height:progress*6.9})})}),_jsx(`path`,{d:`M343.67 1.5C542.684 1.5 685.84 149.351 685.84 344.84C685.84 540.328 542.685 688.18 343.67 688.18C144.655 688.18 1.5 540.318 1.5 344.84C1.50007 149.361 144.655 1.50005 343.67 1.5Z`,fill:`#FCFCF7`,stroke:`#FF5FA2`,strokeWidth:`3`}),_jsx(`path`,{d:`M343.67 0C143.81 0 0 148.55 0 344.84C0 541.13 143.81 689.68 343.67 689.68C543.53 689.68 687.34 541.14 687.34 344.84C687.34 148.54 543.53 0 343.67 0Z`,fill:`#FF5FA2`,clipPath:`url(#progressClip)`}),_jsx(`path`,{d:`M337.89 319.29C337.89 336.75 322.49 350.14 302.81 349.83C286.18 349.57 273.89 337.29 274.37 321.45C274.88 304.82 290.91 290.88 309.98 290.44C325.69 290.09 337.88 302.69 337.88 319.29H337.89Z`,fill:`#4D122C`}),_jsx(`path`,{d:`M566.17 319.29C566.17 336.75 550.77 350.14 531.09 349.83C514.46 349.57 502.17 337.29 502.65 321.45C503.16 304.82 519.19 290.88 538.26 290.44C553.97 290.09 566.16 302.69 566.16 319.29H566.17Z`,fill:`#4D122C`}),_jsx(`path`,{d:`M367.74 342.07C360.22 346.32 359.4 354.9 370.62 366.4C381.85 377.9 399.76 389.56 420.81 389.18C441.88 389.1 460.67 377.72 472.47 363.53C473.83 361.93 478.84 356.88 478.51 351.07C478.32 348.35 476.17 341.19 467.83 341.38C463.46 341.44 461.21 343.68 456.69 347.36C445.2 356.14 432.7 361.21 420.56 361.27C408.43 361.43 395.68 356.17 385.39 347.22C380.32 342.81 375.25 337.82 367.74 342.07Z`,fill:`#4D122C`})]})}),_jsxs(`span`,{className:`guide-sidebar-progress-text`,children:[Math.round(progress),`%`]})]})]}),sections.length>1\u0026\u0026_jsxs(`nav`,{className:`guide-sidebar-section`,\"aria-label\":`On this page`,children:[_jsx(`div`,{className:`guide-sidebar-label`,children:`On this page`}),_jsx(`ul`,{className:`guide-sidebar-toc not-prose`,children:sections.map((section,index)=>_jsx(`li`,{children:_jsx(_components.a,{href:`#${section.id}`,className:index===activeIndex?`is-active`:undefined,\"aria-current\":index===activeIndex?`location`:undefined,onClick:event=>goToSection(event,section.id),children:section.text})},section.id))})]}),category\u0026\u0026_jsxs(`div`,{className:`guide-sidebar-section`,children:[_jsx(`div`,{className:`guide-sidebar-label`,children:`Category`}),_jsxs(`div`,{className:`guide-sidebar-category`,children:[_jsx(Icon,{icon,iconType:`solid`,size:14}),_jsx(`span`,{children:category})]})]}),updatedDate\u0026\u0026_jsxs(`div`,{className:`guide-sidebar-section`,children:[_jsx(`div`,{className:`guide-sidebar-label`,children:`Last updated`}),_jsx(`div`,{className:`guide-sidebar-date`,children:updatedDate})]}),relatedLinks\u0026\u0026relatedLinks.length>0\u0026\u0026_jsxs(`div`,{className:`guide-sidebar-section`,children:[_jsx(`div`,{className:`guide-sidebar-label`,children:`Related`}),_jsx(`ul`,{className:`guide-sidebar-links`,children:relatedLinks.map((link,index)=>_jsx(`li`,{children:_jsx(_components.a,{href:link.href,children:link.title})},index))})]})]})})};const GuideTitle=({title})=>{const[section,setSection]=React.useState(``);React.useEffect(()=>{const onSectionChange=event=>setSection(event.detail\u0026\u0026event.detail.text||``);window.addEventListener(`omni-guide-section`,onSectionChange);if(window.__omniGuideSection)setSection(window.__omniGuideSection);return()=>window.removeEventListener(`omni-guide-section`,onSectionChange)},[]);return _jsxs(`div`,{className:`guide-header`,children:[_jsx(`h1`,{className:`guide-title`,children:title}),_jsx(`div`,{className:`guide-current-section`,\"aria-hidden\":`true`,children:section})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,h2:`h2`,h3:`h3`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Note,OptimizedImage,Step,Steps,Table,Tip,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`GuideSidebar`,children:_jsx(GuideSidebar,{categoryIcons,category:`patterns`,updatedDate:`November 2026`,relatedLinks:[{title:`date_offset_from_query filter operator`,href:`/modeling/filters/operators/date-offset-from-query`},{title:`Measure filters`,href:`/modeling/measures/parameters/filters`},{title:`level_of_detail measure parameter`,href:`/modeling/measures/parameters/level-of-detail`},{title:`Set up a custom calendar`,href:`/guides/modeling/custom-calendars`},{title:`Period-over-period analysis`,href:`/analyze-explore/point-click-queries#period-over-period-analysis`}]})}),`\n`,_jsx(_MdxComponentBoundary,{name:`GuideTitle`,children:_jsx(GuideTitle,{title:`Build like-for-like (same-store) sales reporting`})}),`\n`,_jsx(_components.p,{children:`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.`}),`\n`,_jsx(_components.p,{children:`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.`}),`\n`,_jsx(_components.p,{children:`The examples use Blobby’s Home \u0026 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.`}),`\n`,_jsx(_components.h2,{children:`What the report shows`}),`\n`,_jsx(_components.p,{children:`A like-for-like report usually shows the same few numbers for each product group. This simplified example uses round figures:`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=e2c88f2978d2dfbb21e561d073a9c123`,alt:`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.`,\"data-og-width\":`2400`,width:`2400`,\"data-og-height\":`864`,height:`864`,\"data-path\":`guides/patterns/images/like-for-like-metrics.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?w=280\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=1e6033360b4ef77b4801cf06b0b740d5 280w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?w=560\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=f3d514a8de699c376bc8befc3c8051ee 560w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?w=840\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=f417dfd9187adca1d8109eddfe391ce7 840w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=836f13dc9a0a07432ccff7bb474a0eac 1100w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=ede60ccf26438ddb37318690e99c2936 1650w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-metrics.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=a71fafcc341bd61b87af300cec348c99 2500w`})}),`\n`,_jsx(_components.p,{children:`In plain terms:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Net sales`}),` is everything sold in the period, in every store.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`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.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`LFL growth`}),` is how much more those same stores sold than a year ago.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Weighting`}),` is how big a slice of like-for-like sales each product group is. The slices add up to 100%.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Contribution`}),` is how many points of the total growth each product group added. The points add up to total growth.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`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.`}),`\n`,_jsx(_components.h2,{children:`When to use this pattern`}),`\n`,_jsx(_components.p,{children:`Use this pattern when both of these are true:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`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.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`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.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`If your store set never changes, `,_jsx(_components.a,{href:`/analyze-explore/point-click-queries#period-over-period-analysis`,children:`period-over-period analysis`}),` gives the same comparison with no modeling.`]}),`\n`,_jsx(_components.p,{children:`The steps handle stores that join the comparable set. They don’t cover stores that close or pause trading.`}),`\n`,_jsx(_components.h2,{children:`Requirements`}),`\n`,_jsx(_components.p,{children:`To follow the steps in this guide, you’ll need:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Modeler`}),` or `,_jsx(_components.strong,{children:`Connection Admin`}),` permissions for the connection, so you can edit the shared model`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A sales view`}),` with a sale date, a sales amount, and a store key. The examples use `,_jsx(_components.code,{children:`sales.sale_date`}),`, `,_jsx(_components.code,{children:`sales.net_sales`}),`, and `,_jsx(_components.code,{children:`sales.site_id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A stores view`}),` with the date each store opened. The examples use `,_jsx(_components.code,{children:`stores.opening_date`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A topic that joins the two views.`}),` The examples use a `,_jsx(_components.code,{children:`like_for_like`}),` topic with `,_jsx(_components.code,{children:`sales`}),` as the base view. The fields in this guide reference both views, so they go in the topic’s `,_jsx(_components.a,{href:`/modeling/topics/parameters/views`,children:_jsx(_components.code,{children:`views`})}),` parameter.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A products view joined to the topic`}),`, for the report in the last two steps. The examples use `,_jsx(_components.code,{children:`products.category`}),` and `,_jsx(_components.code,{children:`products.subcategory`}),`.`]}),`\n`]}),`\n`,_jsxs(Steps,{titleSize:`h2`,children:[_jsxs(Step,{title:`Add a last-year measure`,noAnchor:true,children:[_jsxs(_components.p,{children:[`In the topic file, add a measure with a `,_jsx(_components.a,{href:`/modeling/filters/operators/date-offset-from-query`,children:_jsx(_components.code,{children:`date_offset_from_query`})}),` filter. The filter takes the date filter of the query and moves it back one year. `,_jsx(_components.a,{href:`/modeling/filters/operators/cancel-query-filter`,children:_jsx(_components.code,{children:`cancel_query_filter`})}),` stops the query’s own date filter from applying to this measure as well.`]}),_jsx(CodeBlock,{filename:`like_for_like.topic`,numberOfLines:`14`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`views`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sales`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` measures`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sales_ly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Net Sales LY`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${net_sales}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sum`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gbpcurrency_0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sale_date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Take the query's Sale Date filter and move it back one year`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` date_offset_from_query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`1 year`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Stop the query's own Sale Date filter from applying to this measure too`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cancel_query_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`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, `,_jsx(_components.strong,{children:`Net Sales`}),` is £4,757,794 and `,_jsx(_components.strong,{children:`Net Sales LY`}),` is £4,365,612, which matches a query filtered to February through April 2025.`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`A query that uses this measure must have a filter on `,_jsx(_components.code,{children:`sale_date`}),`. Refer to `,_jsx(_components.a,{href:`#troubleshooting`,children:`Troubleshooting`}),` for the error you get without one.`]})})]}),_jsxs(Step,{title:`Define when each store counts`,noAnchor:true,children:[_jsx(_components.p,{children:`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:`}),_jsx(CodeBlock,{filename:`like_for_like.topic`,numberOfLines:`8`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`views`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` stores`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` dimensions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_from_date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL From Date`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # The first date a store counts as like-for-like: one year after it opened.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # DATEADD is database-specific. Use your database's function for adding a year.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"DATEADD(year, 1, ${stores.opening_date})\"})]}),`\n`]})})}),_jsxs(_components.p,{children:[`If your stores table already holds this date, point `,_jsx(_components.code,{children:`sql`}),` at that column instead.`]}),_jsx(_components.p,{children:`Next, add two dimensions to the sales view that test each sales row against that date:`}),_jsx(CodeBlock,{filename:`like_for_like.topic`,numberOfLines:`12`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`views`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sales`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` dimensions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is_lfl_ty_row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Is LFL Row (this year)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # True when the store was already comparable on the day of the sale`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${sales.sale_date} >= ${stores.lfl_from_date}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is_lfl_ly_row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Is LFL Row (last year)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # True when the store is comparable one year after the sale.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # DATEADD is database-specific, as above.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"DATEADD(year, 1, ${sales.sale_date}) >= ${stores.lfl_from_date}\"})]}),`\n`]})})}),_jsx(_components.p,{children:`The two tests are different on purpose:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`This year’s test`}),` keeps a sale if the store was comparable on the sale date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`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.`]}),`\n`]}),_jsx(Frame,{caption:`A store's sales count in both years from the date the store becomes comparable. New stores don't count in either year.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=360de18a4ce02b2762680baac9e59575`,alt:`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.`,\"data-og-width\":`2400`,width:`2400`,\"data-og-height\":`768`,height:`768`,\"data-path\":`guides/patterns/images/like-for-like-store-set.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?w=280\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=d09c6aedff9ea53882992d398400304a 280w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?w=560\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=0d1437dbf9745aae862b14a2ea1b39ce 560w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?w=840\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=70bb0d886b5d851ab7b5d6ce62d7b5eb 840w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=e839544db4351c2a0ce70dd239c0c6c7 1100w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=7565b505709001b70ef21a539b890db6 1650w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-set.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=c48278f240b1b7bac307beb3b6de6d93 2500w`})}),_jsx(_components.p,{children:`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.`})]}),_jsxs(Step,{title:`Add the like-for-like measures`,noAnchor:true,children:[_jsx(_components.p,{children:`Add a measure for each year, each with its own row test, and a growth measure that divides one by the other:`}),_jsx(CodeBlock,{filename:`like_for_like.topic`,expandable:`true`,numberOfLines:`29`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`29`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`views`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sales`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` measures`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # This year: sales in the period, for comparable stores only`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_sales`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL Sales`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${net_sales}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sum`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gbpcurrency_0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is_lfl_ty_row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Last year: the same period one year back, for the same stores`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_sales_ly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL Sales LY`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${net_sales}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sum`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gbpcurrency_0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sale_date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` date_offset_from_query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`1 year`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cancel_query_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is_lfl_ly_row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # NULLIF avoids dividing by zero when there are no sales last year`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_growth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL Growth`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${lfl_sales} / NULLIF(${lfl_sales_ly}, 0) - 1\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`percent_1`})]}),`\n`]})})})]}),_jsxs(Step,{title:`Check the result`,noAnchor:true,children:[_jsxs(_components.p,{children:[`In a workbook, query the topic with the total measures and the like-for-like measures, and filter `,_jsx(_components.code,{children:`sale_date`}),` to a period. For February through April 2026, the example returns:`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{}),_jsx(_components.th,{children:`This year`}),_jsx(_components.th,{children:`Last year`}),_jsx(_components.th,{children:`Growth`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Net sales`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£4,757,794`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£4,365,612`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`9.0%`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Like-for-like sales`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£4,582,709`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£4,296,802`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`6.7%`})]})]})]}),_jsxs(_components.p,{children:[`To see which stores explain the difference, add the store name and `,_jsx(_components.strong,{children:`LFL From Date`}),`. Three stores have sales that the like-for-like measures leave out:`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Store`}),_jsx(_components.th,{children:`LFL from date`}),_jsx(_components.th,{children:`Net sales`}),_jsx(_components.th,{children:`Net sales LY`}),_jsx(_components.th,{children:`LFL sales`}),_jsx(_components.th,{children:`LFL sales LY`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Harbour`}),_jsx(_components.td,{children:`Dec 1, 2026`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£56,527`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Park Gate`}),_jsx(_components.td,{children:`Mar 2, 2027`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£41,054`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Riverside`}),_jsx(_components.td,{children:`May 1, 2026`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£77,504`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£68,810`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£0`})]})]})]}),_jsx(_components.p,{children:`Total sales less these stores equals like-for-like sales in both years.`}),_jsx(_components.p,{children:`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:`}),_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=6f76dc9f505433c870486a377fc4180d`,alt:`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.`,\"data-og-width\":`1632`,width:`1632`,\"data-og-height\":`236`,height:`236`,\"data-path\":`guides/patterns/images/like-for-like-store-joins.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?w=280\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=3fc07ab13f1f234f69ae02ec5170e49d 280w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?w=560\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=16883963208a9b7d04bf059363bacced 560w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?w=840\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=8eaf0032900e14d42420f2a73ffbdc43 840w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=bb3bd1743ea01b1ba0c8da30833c0352 1100w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=e808bcd9c0c0e03bd1473611cf1967e7 1650w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-store-joins.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=7f32a2e561c39fefdb66db7016559a12 2500w`})})]}),_jsxs(Step,{title:`Add weighting and contribution`,noAnchor:true,children:[_jsxs(_components.p,{children:[`Weighting and contribution, described in `,_jsx(_components.a,{href:`#what-the-report-shows`,children:`What the report shows`}),`, both divide a row by a total across all rows. A `,_jsx(_components.a,{href:`/modeling/measures/parameters/level-of-detail`,children:`level of detail`}),` measure provides that total.`]}),_jsx(_components.p,{children:`Add a total for each year that ignores the product grouping, then the two ratios:`}),_jsx(CodeBlock,{filename:`like_for_like.topic`,expandable:`true`,numberOfLines:`41`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`41`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`views`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sales`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` measures`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Like-for-like sales across all products, repeated on every row of the report`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_sales_all_products`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL Sales (all products)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${net_sales}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`max`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gbpcurrency_0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` level_of_detail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sum`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Ignore the product grouping of the query when totalling`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` always_exclude`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`products.category`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`products.subcategory`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is_lfl_ty_row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # The same total for last year`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_sales_ly_all_products`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL Sales LY (all products)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${net_sales}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`max`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gbpcurrency_0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` level_of_detail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sum`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` always_exclude`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`products.category`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`products.subcategory`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sale_date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` date_offset_from_query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`1 year`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cancel_query_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is_lfl_ly_row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # A row's share of like-for-like sales`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_weighting`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Weighting`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${lfl_sales} / NULLIF(${lfl_sales_all_products}, 0)\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`percent_1`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Points of total like-for-like growth that a row adds`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_contribution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Contribution to LFL Growth`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"(${lfl_sales} - ${lfl_sales_ly}) / NULLIF(${lfl_sales_ly_all_products}, 0)\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`percent_2`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`In `,_jsx(_components.code,{children:`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.`]})]}),_jsxs(Step,{title:`Build the report`,noAnchor:true,children:[_jsxs(_components.p,{children:[`In a workbook, select the product dimensions, a quarter field, and the four measures. `,_jsx(_components.a,{href:`/analyze-explore/point-click-queries#pivoting`,children:`Pivot`}),` the quarter, add subtotals by category, and filter `,_jsx(_components.code,{children:`sale_date`}),` to the period that covers both quarters.`]}),_jsx(Frame,{caption:`Like-for-like sales by product group for two quarters, with category subtotals. Synthetic data.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=8cbd2921ee36e46ad25439e5990b4e12`,alt:`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.`,\"data-og-width\":`2306`,width:`2306`,\"data-og-height\":`500`,height:`500`,\"data-path\":`guides/patterns/images/like-for-like-report.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?w=280\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=b7657fa7077e215c0e89335a20b341f7 280w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?w=560\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=5cb750040397a5aa4d83de3903fa9644 560w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?w=840\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=ebed46f6ed2b7f82dfc2d5cc72241bd6 840w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=d08a6f8bfdf50fb362039b37937cf858 1100w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=8db3e454540c2997fa630eff2046ecdd 1650w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-report.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=1b03aa1d5e6b1db0fd470e42a7da9e57 2500w`})}),_jsx(_components.p,{children:`Use these checks to confirm the report is right:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Weightings add up to 100%`}),` in each quarter.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`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%.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Subtotals are calculated again, not averaged.`}),` In Q2 the three Garden \u0026 Outdoor groups grew 12.2%, 3.5%, and 1.9%. Their subtotal is 6.3%, which is the growth of their combined sales.`]}),`\n`]})]})]}),`\n`,_jsx(_components.h2,{children:`Follow a retail calendar`}),`\n`,_jsx(_components.p,{children:`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.`}),`\n`,_jsxs(_components.p,{children:[`In Omni, this is a `,_jsx(_components.a,{href:`/guides/modeling/custom-calendars`,children:`custom calendar`}),`. 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.`]}),`\n`,_jsx(_components.p,{children:`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:`}),`\n`,_jsx(CodeBlock,{filename:`like_for_like.topic`,expandable:`true`,numberOfLines:`35`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`35`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`views`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sales`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` dimensions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # The sale date again, grouped and filtered by the retail calendar`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sale_date_retail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Sale Date (retail calendar)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${sales.sale_date}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` custom_calendar`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`retail_445`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` convert_tz`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` measures`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sales_ly_retail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Net Sales LY (retail calendar)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${net_sales}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sum`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gbpcurrency_0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sale_date_retail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # On a custom calendar, 1 year means the same retail period last year`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` date_offset_from_query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`1 year`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cancel_query_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_sales_ly_retail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL Sales LY (retail calendar)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${net_sales}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` aggregate_type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`sum`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gbpcurrency_0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sale_date_retail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` date_offset_from_query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`1 year`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cancel_query_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is_lfl_ly_row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` lfl_growth_retail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LFL Growth (retail calendar)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${lfl_sales} / NULLIF(${lfl_sales_ly_retail}, 0) - 1\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`percent_1`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`On this dimension the offset counts the calendar’s periods, so `,_jsx(_components.code,{children:`1 year`}),` means the same retail period last year. `,_jsx(_components.code,{children:`lfl_sales`}),` needs no retail version, because it has no offset.`]}),`\n`,_jsxs(_components.p,{children:[`Filter `,_jsx(_components.code,{children:`sale_date_retail`}),` to a named period, such as `,_jsx(_components.code,{children:`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.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`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%.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`By month.`}),` Each retail month is compared with the same retail month last year:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Retail month`}),_jsx(_components.th,{children:`LFL sales`}),_jsx(_components.th,{children:`LFL sales LY`}),_jsx(_components.th,{children:`LFL growth`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`2026-04`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£1,767,707`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£1,664,070`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`6.2%`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`2026-05`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£1,606,016`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£1,548,343`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.7%`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`2026-06`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£1,891,796`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`£1,717,519`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`10.1%`})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`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:`]}),`\n`,_jsx(Frame,{caption:`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.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=ce804eedc2ab13f333c096e88f9905f2`,alt:`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.`,\"data-og-width\":`1632`,width:`1632`,\"data-og-height\":`462`,height:`462`,\"data-path\":`guides/patterns/images/like-for-like-retail-weeks.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?w=280\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=bd22ee32c350cbad9f8ba4e9ebf15062 280w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?w=560\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=b3fe23097abeff338b4b94c1180711d1 560w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?w=840\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=af7008796386fac969b9527a704b3df4 840w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?w=1100\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=5c0aead0960e14a46adcb729bd4ed186 1100w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?w=1650\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=853fae39ebb4681683dac7628280374f 1650w, https://mintcdn.com/omni-e7402367/sB1PrAZvBkPMECbp/guides/patterns/images/like-for-like-retail-weeks.png?w=2500\u0026fit=max\u0026auto=format\u0026n=sB1PrAZvBkPMECbp\u0026q=85\u0026s=dfbf02de5a4206c97d6f3b64102192c1 2500w`})}),`\n`,_jsx(_components.p,{children:`Keep these rules in mind:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Name the period in the filter.`}),` A filter on specific dates moves back by a Gregorian year. Refer to `,_jsx(_components.a,{href:`/modeling/models/custom-calendars#period-over-period`,children:`Period over period`}),` for the rules.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Keep the calendar table ahead of today.`}),` A filter such as `,_jsx(_components.code,{children:`this quarter`}),` ends at the start of the next retail quarter. If the calendar table stops before that date, the query returns no rows.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`The row tests still use calendar dates.`}),` `,_jsx(_components.code,{children:`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.`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Without a custom calendar, an offset of `,_jsx(_components.code,{children:`364 days`}),` in place of `,_jsx(_components.code,{children:`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.`]})}),`\n`,_jsx(_components.h2,{children:`Ask the Omni Agent`}),`\n`,_jsxs(_components.p,{children:[`Because the logic is in the model, people can also ask like-for-like questions in the `,_jsx(_components.a,{href:`/ai/chat`,children:`Omni Agent`}),`, without anyone building a report first. These questions were tested on the example model:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`“Is our sales growth in February to April 2026 coming from existing stores or from new ones?”`}),`\n`,_jsx(_components.li,{children:`“Which stores are left out of like-for-like for February to April 2026, and why?”`}),`\n`,_jsx(_components.li,{children:`“Which three stores had the best comps in February to April 2026?”`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`People use many names for the same number. List them in the topic’s `,_jsx(_components.a,{href:`/modeling/topics/parameters/ai-context`,children:_jsx(_components.code,{children:`ai_context`})}),`, and say which measures answer them:`]}),`\n`,_jsx(CodeBlock,{filename:`like_for_like.topic`,numberOfLines:`4`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`ai_context`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 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.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 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.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` For total sales against last year, use sales.net_sales_total and sales.sales_ly.`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`To check that the agent uses your measures, run an `,_jsx(_components.a,{href:`/ai/evals`,children:`eval`}),`. 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.`]}),`\n`,_jsx(_components.p,{children:`On the example model, a set of 25 questions was run before and after adding the context above:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Before:`}),` 24 of 25 passed. Clear labels were enough for the agent to find `,_jsx(_components.strong,{children:`LFL Sales`}),`, `,_jsx(_components.strong,{children:`LFL Sales LY`}),`, and `,_jsx(_components.strong,{children:`LFL Growth`}),`. The one miss was “comparable store sales growth”. The agent read “store” literally and left out the online sites.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`After:`}),` 25 of 25 passed.`]}),`\n`]}),`\n`,_jsx(_components.h2,{children:`Troubleshooting`}),`\n`,_jsx(_components.h3,{children:`The query fails with “Invalid offset filter”`}),`\n`,_jsxs(_components.p,{children:[`The full message is `,_jsx(_components.code,{children:`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.`]}),`\n`,_jsxs(_components.p,{children:[`Add a filter on `,_jsx(_components.code,{children:`sale_date`}),` to the query. To start every new query with one, add `,_jsx(_components.a,{href:`/modeling/topics/parameters/default-filters`,children:_jsx(_components.code,{children:`default_filters`})}),` to the topic.`]}),`\n`,_jsx(_components.h3,{children:`Period over period shows a different growth rate`}),`\n`,_jsxs(_components.p,{children:[`The workbook’s `,_jsx(_components.a,{href:`/analyze-explore/point-click-queries#period-over-period-analysis`,children:`period-over-period analysis`}),` applies one measure to both periods. On `,_jsx(_components.strong,{children:`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 `,_jsx(_components.strong,{children:`LFL Sales`}),` with `,_jsx(_components.strong,{children:`LFL Sales LY`}),` instead.`]}),`\n`,_jsx(_components.h2,{children:`Next steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/modeling/filters/operators/date-offset-from-query`,children:_jsx(_components.code,{children:`date_offset_from_query`})}),` for other offsets, such as `,_jsx(_components.code,{children:`364 days`}),` or `,_jsx(_components.code,{children:`52 weeks`}),` to line up weekdays`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/modeling/measures/parameters/level-of-detail`,children:_jsx(_components.code,{children:`level_of_detail`})}),` for the other ways to group a total`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/guides/modeling/custom-calendars`,children:`Set up a custom calendar`}),` to group and compare by retail periods`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/visualize-present/visualizations/types/table`,children:`Table visualizations`}),` to format the report for a dashboard`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/ai/evals`,children:`Evals`}),` to test that the Omni Agent answers like-for-like questions from these measures`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{categoryIcons,GuideSidebar,GuideTitle,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Build like-for-like (same-store) sales reporting","description":"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.","goal":"Build like-for-like sales measures that compare the same stores over the same period, for any period a user picks.","tags":["patterns","modeling"],"keywords":["like-for-like","like for like","LFL","same-store sales","same store sales","SSS","comparable store sales","comparable sales","comps","comp sales","same-site sales","organic growth","underlying growth","constant store base","year over year","retail","retail calendar","4-4-5","date_offset_from_query","level of detail"],"mode":"custom","href":"/guides/patterns/like-for-like-sales"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[148,8410,"undefined;const GuideSidebar=()=>null;const GuideTitle=()=>null;function _create"]]},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/omni-e7402367/d319afcbd743bc1a/docs-assistant.js"],"subdomain":"omni-e7402367","siteName":"Omni Docs","title":"Build like-for-like (same-store) sales reporting - Omni Docs","relatedPagesConfig":{"enabled":true,"limit":3,"mode":"manual"},"contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{},"searchTabScopes":[{"tab":"Docs"},{"tab":"Admin"},{"tab":"Guides"},{"tab":"Library"},{"tab":"Developers"},{"tab":"Product updates"}]},"lastModified":"2026-11-27T18:58:22.081Z","originalFileLocation":"guides/patterns/like-for-like-sales.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"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.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Omni Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Build like-for-like (same-store) sales reporting - Omni Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"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.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Omni Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.omni.co/guides/patterns/like-for-like-sales\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://omni-e7402367.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Build+like-for-like+%28same-store%29+sales+reporting\u0026amp;description=Compare+sales+with+the+same+period+last+year+for+comparable+stores+only%2C+also+known+as+same-store+or+comparable+store+sales%2C+using+filtered+measures+that+follow\u0026amp;theme=f0d77b05d3972e3534869d72\u0026amp;signature=97e28f5f0f991dec8f852ae1ba0aa5988bd3f3698209ef3700b187e315e46f26\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Build like-for-like (same-store) sales reporting - Omni Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"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.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://omni-e7402367.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Build+like-for-like+%28same-store%29+sales+reporting\u0026amp;description=Compare+sales+with+the+same+period+last+year+for+comparable+stores+only%2C+also+known+as+same-store+or+comparable+store+sales%2C+using+filtered+measures+that+follow\u0026amp;theme=f0d77b05d3972e3534869d72\u0026amp;signature=97e28f5f0f991dec8f852ae1ba0aa5988bd3f3698209ef3700b187e315e46f26\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/omni-e7402367/Hcd24pRrgU0Go9sj/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Omni Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF5FA2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.omni.co/guides/patterns/like-for-like-sales\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/patterns/like-for-like-sales.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.omni.co/#organization\",\"name\":\"Omni Docs\",\"url\":\"https://docs.omni.co\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/omni-e7402367/m1fg0tfdkEcnYhky/images/logo/omni-black.png?fit=max\u0026auto=format\u0026n=m1fg0tfdkEcnYhky\u0026q=85\u0026s=85b81b605382b15b60eb75159899002a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.omni.co#website\",\"name\":\"Omni Docs\",\"url\":\"https://docs.omni.co\",\"publisher\":{\"@id\":\"https://docs.omni.co/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.omni.co/guides/patterns/like-for-like-sales#webpage\",\"url\":\"https://docs.omni.co/guides/patterns/like-for-like-sales\",\"name\":\"Build like-for-like (same-store) sales reporting\",\"description\":\"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.\",\"dateModified\":\"2026-11-27T18:58:22.081Z\",\"isPartOf\":{\"@id\":\"https://docs.omni.co#website\"}},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.omni.co/guides/patterns/like-for-like-sales#article\",\"headline\":\"Build like-for-like (same-store) sales reporting\",\"name\":\"Build like-for-like (same-store) sales reporting\",\"description\":\"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.\",\"url\":\"https://docs.omni.co/guides/patterns/like-for-like-sales\",\"mainEntityOfPage\":{\"@id\":\"https://docs.omni.co/guides/patterns/like-for-like-sales#webpage\"},\"dateModified\":\"2026-11-27T18:58:22.081Z\",\"keywords\":\"like-for-like, like for like, LFL, same-store sales, same store sales, SSS, comparable store sales, comparable sales, comps, comp sales, same-site sales, organic growth, underlying growth, constant store base, year over year, retail, retail calendar, 4-4-5, date_offset_from_query, level of detail\",\"publisher\":{\"@id\":\"https://docs.omni.co/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.omni.co#website\"}}]}\u003c/script>","agentPointerHref":"/guides/patterns/like-for-like-sales.md","siteName":"Omni Docs","nav":{"global":null,"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":""}]},{"tab":"Admin","pages":[{"title":"Admin","href":"/administration"}]},{"tab":"Guides","pages":[{"title":"Guides","mode":"custom","href":"/guides"},{"title":"Gate content creation with ai_context","mode":"custom","href":"/guides/ai/gate-ai-content-creation"},{"title":"Improving AI answer quality","mode":"custom","href":"/guides/ai/improve-ai-answer-quality"},{"title":"Tuning Omni AI for cost and quality","mode":"custom","href":"/guides/ai/tuning-cost-quality"},{"title":"Bulk update model YAML files with the API","mode":"custom","href":"/guides/api/bulk-update-model-yaml"},{"title":"Set up connection environments with the API","mode":"custom","href":"/guides/api/connection-environments"},{"title":"Build a data lineage integration with the Omni API","mode":"custom","href":"/guides/api/data-lineage-integration"},{"title":"Port SQL queries into an Omni workbook via API","mode":"custom","href":"/guides/api/port-sql-queries-omni-api"},{"title":"Rotate Git SSH deploy keys with the API","mode":"custom","href":"/guides/api/rotate-ssh-deploy-keys"},{"title":"Run document queries with the Query API","mode":"custom","href":"/guides/api/run-document-queries"},{"title":"Enforce database RBAC in Omni with connection environments","mode":"custom","href":"/guides/connections/enforce-database-rbac"},{"title":"Filter dashboard charts with calculated fields","mode":"custom","href":"/guides/dashboards/calculated-field-filter"},{"title":"Dashboard best practices","mode":"custom","href":"/guides/dashboards/dashboarding-best-practices"},{"title":"Embed dbt platform data health tiles in Omni dashboards and apps","mode":"custom","href":"/guides/dashboards/dbt-data-health-tiles"},{"title":"Migrate a dashboards to a new connection","mode":"custom","href":"/guides/dashboards/migrate-dashboards"},{"title":"Swap dashboard identifiers","mode":"custom","href":"/guides/dashboards/swap-dashboard-identifiers"},{"title":"Choosing your deployment","mode":"custom","href":"/guides/deployment/choosing-your-deployment"},{"title":"Deploying Omni: Multiple instances across multiple regions","mode":"custom","href":"/guides/deployment/multi-instance-multi-region"},{"title":"Deploying Omni: Multiple instances (Prod/Stage)","mode":"custom","href":"/guides/deployment/multi-instance-prod-stage"},{"title":"Deploying Omni at scale with shared model extensions","mode":"custom","href":"/guides/deployment/scaled-deployments-shared-model-extensions"},{"title":"Deploying Omni: Single instance with dynamic connections","href":"/guides/deployment/single-instance-dynamic-connections"},{"title":"Deploying Omni: Single instance deployment with git and dbt","mode":"custom","href":"/guides/deployment/single-instance-git-dbt"},{"title":"Connect a chat agent to Omni AI for embed experiences","mode":"custom","href":"/guides/embed/ai-chat-agent"},{"title":"Designing a fully bespoke embed experience","mode":"custom","href":"/guides/embed/customizing-embed-experience"},{"title":"Choosing your embed configuration","mode":"custom","href":"/guides/embed/embed-configuration-scenarios"},{"title":"Embed environment architecture","mode":"custom","href":"/guides/embed/embed-development-production-setup"},{"title":"Save and restore dashboard filters and controls in embedded apps","mode":"custom","href":"/guides/embed/embed-using-js-events"},{"title":"Embedding Omni into internal applications","mode":"custom","href":"/guides/embed/omni-in-internal-app"},{"title":"Embedding Omni in your Notion instance","mode":"custom","href":"/guides/embed/omni-in-notion"},{"title":"Embedding Omni in your Salesforce instance","mode":"custom","href":"/guides/embed/omni-in-salesforce"},{"title":"Triage 'Failed to fetch' browser errors","mode":"custom","href":"/guides/errors/failed-to-fetch"},{"title":"Resolve 'Join fans out data without primary key' errors","mode":"custom","href":"/guides/errors/fan-out-without-pk"},{"title":"Find and fix missing or quarantined Omni emails","mode":"custom","href":"/guides/errors/missing-omni-emails"},{"title":"Migrating Looker dashboards to Omni","mode":"custom","href":"/guides/migrations/looker-to-omni-skill"},{"title":"Set up a custom calendar","mode":"custom","href":"/guides/modeling/custom-calendars"},{"title":"Improving date flexibility with templated filters","mode":"custom","href":"/guides/modeling/date-flexibility-templated-filters"},{"title":"Customizing filter suggestions","mode":"custom","href":"/guides/modeling/filter-suggestions"},{"title":"Count GA4 events exactly, including today","mode":"custom","href":"/guides/modeling/ga4-exact-counts-with-intraday"},{"title":"Join to the same table twice","mode":"custom","href":"/guides/modeling/join-to-same-table"},{"title":"Local development with the model editor CLI","mode":"custom","href":"/guides/modeling/local-development"},{"title":"Organize fields with nested groups","mode":"custom","href":"/guides/modeling/nested-field-groups"},{"title":"Preview dbt changes in Omni before merging to production","mode":"custom","href":"/guides/modeling/preview-dbt-changes"},{"title":"Push Omni topics to Databricks as metric views","mode":"custom","href":"/guides/modeling/push-to-databricks-metric-views"},{"title":"Safely rename a git-connected shared model","mode":"custom","href":"/guides/modeling/rename-git-connected-shared-model"},{"title":"Apply a filter to a single measure","mode":"custom","href":"/guides/modeling/single-field-filter"},{"title":"Using Level of Detail functions for cohorting analysis","mode":"custom","href":"/guides/patterns/build-cohort-analysis-using-level-of-detail"},{"title":"Using AI to build a cohort analysis with month offset","mode":"custom","href":"/guides/patterns/cohort-analysis-month-offset-ai"},{"title":"Building a dynamic pivot query view","mode":"custom","href":"/guides/patterns/dynamic-pivot-query-view"},{"title":"Choosing between LOD fields, window functions, CTEs, and Excel","description":"Compare Omni LOD fields, SQL window functions, CTEs, and Excel for multi-level aggregation and cohort analysis.","mode":"custom","href":"/guides/patterns/level-of-detail-build-comparison"},{"title":"Build like-for-like (same-store) sales reporting","mode":"custom","href":"/guides/patterns/like-for-like-sales"},{"title":"Report opening and closing balances from a ledger","description":"Turn a transactional ledger into opening, closing, and movement balances that stay correct across any dimension, using a daily snapshot and omni_dimensionalize.","mode":"custom","href":"/guides/patterns/opening-closing-balances"},{"title":"Optimizing AI context for fintech and banking","mode":"custom","href":"/guides/patterns/optimizing-ai-context-for-fintech"},{"title":"Optimizing AI context for retail and ecommerce","mode":"custom","href":"/guides/patterns/optimizing-ai-context-for-retail-and-ecommerce"},{"title":"Optimizing AI context for SaaS and sales operations","mode":"custom","href":"/guides/patterns/optimizing-ai-context-for-saas-and-sales-operations"},{"title":"Optimizing AI context for support operations","mode":"custom","href":"/guides/patterns/optimizing-ai-context-for-support-operations"},{"title":"Optimizing AI context for Media and AdTech","mode":"custom","href":"/guides/patterns/optimizing-ai-context-media-and-adtech"},{"title":"Use public images in Omni content and AI branding","mode":"custom","href":"/guides/patterns/public-image-urls"},{"title":"Building a basic cohort analysis with pivots","mode":"custom","href":"/guides/patterns/simple-cohort-analysis-pivot"},{"title":"Cohort analysis using a thin spine","mode":"custom","href":"/guides/patterns/spine-cohort-analysis"},{"title":"Thin dimensional spine for multi-fact event analysis","mode":"custom","href":"/guides/patterns/thin-dimension-spine"},{"title":"Add links to visualizations","mode":"custom","href":"/guides/visualizations/add-links"},{"title":"Combine GeoJSON files with AI to build custom region maps","mode":"custom","href":"/guides/visualizations/combine-geojson-files-with-ai"},{"title":"Customize drill fields","mode":"custom","href":"/guides/workbooks/custom-drill-fields"},{"title":"Build a forecast input app that writes to your data warehouse","mode":"custom","href":"/guides/workbooks/forecast-input-app"},{"title":"Point-in-time snapshots with parameters","mode":"custom","href":"/guides/workbooks/snapshots-with-parameters"}]},{"tab":"Library","pages":[{"title":"Library","href":"/library"}]},{"tab":"Developers","menu":[{"item":"REST APIs","icon":"cloud","description":"Programmatically interact with Omni","pages":[{"title":"REST APIs","href":"/api"}]},{"item":"Embedding","icon":"chart-column","description":"Embed Omni's analytics \u0026 AI in apps","pages":[{"title":"Embedding","href":"/embed"}]},{"item":"CLI","icon":"terminal","description":"Interact with Omni APIs from the terminal","pages":[{"title":"CLI","href":"/developers/cli"}]},{"item":"Agent skills","icon":"robot","description":"Bring Omni workflows into your agent environment","pages":[{"title":"Agent skills","href":"/developers/agent-skills"}]}],"pages":[{"title":"Developers","href":"/api"}]},{"tab":"Product updates","menu":[{"item":"Demos","icon":"rocket","description":"Weekly updates of upcoming and experimental features","pages":[{"title":"Demos","href":"/demos"}]},{"item":"Changelog","icon":"file-lines","description":"New features, improvements, and bug fixes","pages":[{"title":"Changelog","href":"/changelog"}]}],"pages":[{"title":"Product updates","href":"/demos"}]}]},"basePath":"","title":"Build like-for-like (same-store) sales reporting - Omni Docs","deploymentId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","buildId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","dynamics":["10e4515597","07c022d89b","a74be98ba7"],"chunks":["BannerMarkdown-BUsnMns2.js","dist-OmDnwAnM.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","Frame-CUYDhsh7.js","DynamicMarkdown-D8KwOkxZ.js","zoom-image-lightbox-lceUjs6n.js","lightbox-handle-r17bVUz3.js"]}