The Lead/Lag transformation component retrieves values from table rows preceding or following the current row.
The LEAD function returns the values for a row at a given offset after the current row in the partition.
The LAG function returns the values for a row at a given offset before the current row in the partition.
In SQL terms, these are equivalent to using the LEAD ... OVER or LAG ... OVER clauses of a SELECT statement.You can combine multiple LEAD and/or LAG operations in a single instance of the component, letting you obtain a range of offset data from the input dataset.The component uses the window functions supported by your cloud data warehouse. Window functions operate on a partition or “window” of a dataset. More details of these functions can be found in your cloud data warehouse documentation:
Because Lead/Lag allows you to look forward or backward at other rows in a dataset, it’s helpful in time series and analytical processing. Some common uses for this include:
Calculating changes over time. For example, using LAG to obtain the difference between the current day and the previous day when days are expressed as different rows in the dataset.
Detecting trends and identifying outliers. For example, using LEAD to obtain this month’s spending and compare it to next month’s, and flagging instances where the trend is downward.
Building cumulative or rolling metrics. For example, using multiple LAG functions to obtain data from one day ago, two days ago, and so on.
Properties
Snowflake
Databricks
Amazon Redshift
Google BigQuery
string
required
A human-readable name for the component.
boolean
required
When Yes, the component passes all input columns into the output.
object selector
Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
Input Column: The input column name for sorting within the partitioned data. You can drag columns to reorder them.
Ordering: The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
required
Window Function:
Lead: Returns the column from an Offset number of rows after the current row. For more information, read the Snowflake Lead documentation.
Lag: Returns the column from an Offset number of rows before the current row. For more information, read the Snowflake Lag documentation.
Input Column: The name of the input column that the Lead/Lag function will retrieve data from.
Offset: The number of rows to look forward (Lead) or backward (Lag) in the partition.
Output Column: The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
boolean
required
When Yes, disregard null values when determining which row to use. Null values don’t count toward reaching the offset.
string
required
A human-readable name for the component.
boolean
required
When Yes, the component passes all input columns into the output.
object selector
Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
Input Column: The input column name for sorting within the partitioned data. You can drag columns to reorder them.
Ordering: The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
required
Window Function:
Lead: Returns the column from an Offset number of rows after the current row. For more information, read the Databricks Lead documentation.
Lag: Returns the column from an Offset number of rows before the current row. For more information, read the Databricks Lag documentation.
Input Column: The name of the input column that the Lead/Lag function will retrieve data from.
Offset: The number of rows to look forward (Lead) or backward (Lag) in the partition.
Output Column: The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
boolean
required
When Yes, disregard null values when determining which row to use. Null values don’t count toward reaching the offset.
string
required
A human-readable name for the component.
boolean
required
When Yes, the component passes all input columns into the output.
object selector
Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
Input Column: The input column name for sorting within the partitioned data. You can drag columns to reorder them.
Ordering: The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
required
Window Function:
Lead: Returns the column from an Offset number of rows after the current row. For more information, read the Amazon Redshift Lead documentation.
Lag: Returns the column from an Offset number of rows before the current row. For more information, read the Amazon Redshift Lag documentation.
Input Column: The name of the input column that the Lead/Lag function will retrieve data from.
Offset: The number of rows to look forward (Lead) or backward (Lag) in the partition.
Output Column: The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
boolean
required
When Yes, disregard null values when determining which row to use. Null values don’t count toward reaching the offset.
string
required
A human-readable name for the component.
boolean
required
When Yes, the component passes all input columns into the output.
object selector
Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
Input Column: The input column name for sorting within the partitioned data. You can drag columns to reorder them.
Ordering: The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
column editor
required
Window Function:
Lead: Returns the column from an Offset number of rows after the current row. For more information, read the Google BigQuery Lead documentation.
Lag: Returns the column from an Offset number of rows before the current row. For more information, read the Google BigQuery Lag documentation.
Input Column: The name of the input column that the Lead/Lag function will retrieve data from.
Offset: The number of rows to look forward (Lead) or backward (Lag) in the partition.
Output Column: The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.
Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Maia Documentation","colors":{"primary":"#001f1d","light":"#20514e","dark":"#001f1d"},"logo":{"light":"https://mintcdn.com/matillion/GyuNBHAx-GXnVlKX/images/maia-by-matillion-light.svg?fit=max\u0026auto=format\u0026n=GyuNBHAx-GXnVlKX\u0026q=85\u0026s=2c48b854f858c5a835450b3f34360db7","dark":"https://mintcdn.com/matillion/GyuNBHAx-GXnVlKX/images/maia-by-matillion-dark.svg?fit=max\u0026auto=format\u0026n=GyuNBHAx-GXnVlKX\u0026q=85\u0026s=88f8d1e1b1931cefd35c233a56cafe0a","href":"https://docs.maia.ai/"},"favicon":{"light":"https://mintcdn.com/matillion/0xM0A92Owv1nZXX1/images/maia-favicon-dark-green.png?fit=max\u0026auto=format\u0026n=0xM0A92Owv1nZXX1\u0026q=85\u0026s=356295fc83c5c6d1ed4aac2573ae45b1","dark":"https://mintcdn.com/matillion/0xM0A92Owv1nZXX1/images/maia-favicon-white.png?fit=max\u0026auto=format\u0026n=0xM0A92Owv1nZXX1\u0026q=85\u0026s=8709fc6d370155352cb6a4b5bbdd59d6"},"appearance":{"default":"light","strict":true},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://support.matillion.com/s/","label":"Support"}],"primary":{"type":"button","label":"Book your Maia demo","href":"https://www.maia.ai/book-a-demo"}},"footer":{"socials":{"x":"https://x.com/matillion","facebook":"https://www.facebook.com/matillion","youtube":"https://www.youtube.com/user/MatillionVideos","linkedin":"https://www.linkedin.com/company/matillion-limited","instagram":"https://www.instagram.com/matillion_"},"links":[{"header":"Maia","items":[{"label":"Maia.ai","href":"https://maia.ai"},{"label":"Academy","href":"https://academy.matillion.com"},{"label":"Exchange","href":"https://exchange.matillion.com/"},{"label":"Roadmap","href":"https://roadmap.matillion.com/"},{"label":"Support","href":"https://support.matillion.com/s"},{"label":"YouTube","href":"https://www.youtube.com/@Matillion"}]},{"header":"Matillion","items":[{"label":"Matillion.com","href":"https://matillion.com"},{"label":"Status","href":"https://status.matillion.com/"},{"label":"News","href":"https://www.matillion.com/news"},{"label":"Legal","href":"https://www.matillion.com/legal"},{"label":"Trust Center","href":"https://www.matillion.com/trust-center"}]}]},"seo":{"metatags":{"google-site-verification":"0VLXGRESICGHnU66TdhEgUMBRRubPnW8JTkzOpiiNn0"}},"fonts":{"heading":{"family":"Inter, system-ui"},"body":{"family":"Inter, system-ui"}},"integrations":{"ga4":{"measurementId":"G-6T2W93NTXW"},"posthog":{"apiKey":"phc_ky6YtuQApuXUkdApnVTY5PrjvnHx7EQGtYyRVSd9G535","apiHost":"https://us.i.posthog.com"}},"contextual":{"options":["claude","chatgpt","perplexity","copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"matillion","hasAudioNarration":false,"actualSubdomain":"matillion","customDomains":["docs.maia.ai"],"gitSource":{"type":"github","owner":"matillion","repo":"maia-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"DISABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af73146bd8b0362cded8904","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Components","count":356},{"language":"default","tag":"Guides","count":210},{"language":"default","tag":"Connectors","count":188},{"language":"default","tag":"API Reference","count":128},{"language":"default","tag":"Endpoints","count":113},{"language":"default","tag":"Orchestration","count":94},{"language":"default","tag":"Admin","count":70},{"language":"default","tag":"Transformation","count":69},{"language":"default","tag":"Runners","count":51},{"language":"default","tag":"Streaming","count":34}],"searchSettings":{"showContentSnippets":false}},"assistantConfig":{},"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":"workos-onboarding","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":"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":"assistant-v5","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":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"#navbar .bg-background-light,#navbar .bg-background-dark{background-color:#001f1d!important}#navbar a,#navbar button,#navbar span,#navbar p{color:white!important}#navbar svg{color:white!important;stroke:white!important}#navbar #topbar-cta-button a,#navbar #topbar-cta-button a span,#navbar #topbar-cta-button svg{color:#001f1d!important}#navbar #topbar-cta-button a{font-weight:600!important}:root:not(.dark) #search-bar-entry,:root:not(.dark) #nav-anchor,:root:not(.dark) #navbar .navbar-link,:root:not(.dark) .nav-anchor{background-color:#0a3d39!important;border-radius:9999px!important}#topbar-cta-button a span.bg-primary-dark{background:#ffc700!important;border-radius:9999px!important}#navbar svg.bg-gray-500{background-color:white!important}#navbar button.lg\\:hidden div.font-semibold{color:white!important}#navbar button.lg\\:hidden div.text-gray-500 svg{color:white!important;stroke:white!important}#navbar img.nav-logo{content:url('/images/maia-by-matillion-light.svg');height:50px!important;width:auto!important}#footer img.nav-logo{content:url('/images/maia-by-matillion-dark.svg');height:80px!important;width:auto!important}#pagination{display:none}#navigation-items>div{padding-bottom:4rem!important}#navbar a[data-active=\"true\"] div.h-px{height:4px!important;background-color:#ffc700!important;border-radius:9999px!important}[id^=\"headlessui-dialog-panel\"] .navbar-link a{color:white!important}[id^=\"headlessui-dialog-panel\"] nav{padding-top:2.5rem}.accordion{width:100%!important;overflow-x:auto!important}.accordion>div{padding-left:1.375rem!important;padding-right:0!important}.accordion>div[class*=\"overflow\"],.accordion>div>div[class*=\"overflow\"]{overflow:visible!important}@media (min-width: 1920px){body:has(#navbar.is-not-custom) #body-content{max-width:2000px!important}body:has(#navbar.is-not-custom) #content-container{max-width:1650px!important}body:has(#navbar.is-not-custom) #navbar .max-w-8xl{max-width:2000px!important}}body:has(#navbar.is-not-custom) #content{zoom:var(--maia-content-zoom, 100%)}body:has(#navbar.is-not-custom) #content-area>#content+div:has(>p+a){zoom:var(--maia-content-zoom, 100%)}#content-area>#content+div:has(>p+a)>p{font-size:1.5rem;line-height:2rem;font-weight:600;letter-spacing:normal;color:#101828;margin-bottom:0.5rem}.dark #content-area>#content+div:has(>p+a)>p{color:inherit}#content-area>#content+div:has(>p+a)>a{font-size:1rem;line-height:1.75rem}"},{"filePath":"new-features-blog/new-features-blog.css","content":".fos-background-container{position:fixed;top:0;left:0;height:100vh;width:100vw;background:#fff3d1;z-index:-1;background-size:cover}.fos-post-page-container{background-color:#fff;border-radius:20px;padding:20px!important}.fos-roadmap-page-container{background-color:#fff;border-radius:20px;width:95%}@media (min-width: 1024px){.fos-roadmap-page-container{width:70%;margin:0 auto}}.fos-changelog-page-container{background-color:#fff;border-radius:20px}.banner-title,.fos-header-banner-title{color:#00524E;font-size:4rem;font-weight:700;font-family:'Inter', sans-serif}.banner-subtitle,.fos-header-banner-subtitle{color:#001F1D;font-size:1.1487em;margin-top:0.5em;margin-bottom:2em}.fos-header-boards-trigger,.fos-header-roadmap-trigger,.fos-header-changelog-trigger{display:none}.fos-user-side-header{color:white;font-family:'Inter', sans-serif}.fos-header-container{background-color:#001f1d;box-shadow:0px 1px 13px #bfbfbf}.fos-header-boards-dropdown-content span{color:white}.fos-header-links-container{justify-content:center;gap:1em}.fos-header-link{color:white;font-size:14px!important;font-weight:bold;padding:10px 0}.fos-header-logo-container{display:flex}.fos-header-logo-image{width:100px}.fos-header-boards-link{color:white;font-size:16px;padding:10px 0;font-weight:bold}.fos-header-link-icon{color:white}"}],"page":{"pagePath":"docs/components/lead-lag","slug":"/docs/components/lead-lag","pageMetadata":{"title":"Lead/Lag","description":null,"href":"/docs/components/lead-lag"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const ComponentMetadata=({warehouses,unsupportedWarehouses=[],componentType,connectionInputs,connectionOutputs,driverVersion,driverVersionUrl})=>{const _components={a:`a`,..._provideComponents()};const allWarehouses=[...warehouses.map(w=>({name:w,supported:true})),...unsupportedWarehouses.map(w=>({name:w,supported:false}))];return _jsx(`div`,{style:{background:`var(--colors-background-light, #f9fafb)`,border:`1px solid var(--colors-border-default, #e5e7eb)`,borderRadius:`12px`,padding:`20px 28px`,marginBottom:`28px`,boxShadow:`0 1px 4px rgba(0,0,0,0.10)`},children:_jsx(`table`,{style:{width:`100%`,borderCollapse:`collapse`},children:_jsxs(`tbody`,{children:[_jsxs(`tr`,{children:[_jsx(`td`,{style:{fontWeight:`600`,paddingRight:`32px`,paddingBottom:`14px`,whiteSpace:`nowrap`,verticalAlign:`middle`,width:`180px`},children:`Project Availability`}),_jsx(`td`,{style:{paddingBottom:`14px`,verticalAlign:`middle`},children:_jsx(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:`8px`},children:allWarehouses.map((w,i)=>_jsxs(`span`,{style:{background:w.supported?`#dcfce7`:`#fee2e2`,color:w.supported?`#15803d`:`#b91c1c`,border:`1px solid ${w.supported?`#bbf7d0`:`#fca5a5`}`,borderRadius:`9999px`,padding:`3px 12px`,fontSize:`0.85rem`,fontWeight:`500`,whiteSpace:`nowrap`},children:[w.name,` `,w.supported?`✅`:`❌`]},i))})})]}),_jsxs(`tr`,{children:[_jsx(`td`,{style:{fontWeight:`600`,paddingRight:`32px`,paddingBottom:`14px`,whiteSpace:`nowrap`,verticalAlign:`middle`},children:`Component Type`}),_jsx(`td`,{style:{paddingBottom:`14px`,verticalAlign:`middle`},children:componentType})]}),_jsxs(`tr`,{children:[_jsx(`td`,{style:{fontWeight:`600`,paddingRight:`32px`,paddingBottom:`14px`,whiteSpace:`nowrap`,verticalAlign:`middle`},children:`Connection Inputs`}),_jsx(`td`,{style:{paddingBottom:`14px`,verticalAlign:`middle`},children:connectionInputs})]}),_jsxs(`tr`,{children:[_jsx(`td`,{style:{fontWeight:`600`,paddingRight:`32px`,paddingBottom:driverVersion?`14px`:`0`,whiteSpace:`nowrap`,verticalAlign:`middle`},children:`Connection Outputs`}),_jsx(`td`,{style:{paddingBottom:driverVersion?`14px`:`0`,verticalAlign:`middle`},children:connectionOutputs})]}),driverVersion\u0026\u0026_jsxs(`tr`,{children:[_jsx(`td`,{style:{fontWeight:`600`,paddingRight:`32px`,whiteSpace:`nowrap`,verticalAlign:`middle`},children:`Driver Version`}),_jsx(`td`,{style:{verticalAlign:`middle`},children:driverVersionUrl?_jsx(_components.a,{href:driverVersionUrl,target:`_blank`,rel:`noopener noreferrer`,children:driverVersion}):driverVersion})]})]})})})};function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,ResponseField,Tab,Tabs,_MdxComponentBoundary}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`ComponentMetadata`,children:_jsx(ComponentMetadata,{warehouses:[`Snowflake`,`Databricks`,`Amazon Redshift`,`Google BigQuery`],componentType:`Transformation`,connectionInputs:`One`,connectionOutputs:`Unlimited`})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Lead/Lag`}),` transformation component retrieves values from table rows preceding or following the current row.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.strong,{children:`LEAD`}),` function returns the values for a row at a given offset after the current row in the partition.`]}),`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.strong,{children:`LAG`}),` function returns the values for a row at a given offset before the current row in the partition.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`In SQL terms, these are equivalent to using the `,_jsx(_components.code,{children:`LEAD ... OVER`}),` or `,_jsx(_components.code,{children:`LAG ... OVER`}),` clauses of a `,_jsx(_components.code,{children:`SELECT`}),` statement.`]}),`\n`,_jsxs(_components.p,{children:[`You can combine multiple `,_jsx(_components.strong,{children:`LEAD`}),` and/or `,_jsx(_components.strong,{children:`LAG`}),` operations in a single instance of the component, letting you obtain a range of offset data from the input dataset.`]}),`\n`,_jsxs(_components.p,{children:[`The component uses the `,_jsx(_components.strong,{children:`window`}),` functions supported by your cloud data warehouse. Window functions operate on a partition or “window” of a dataset. More details of these functions can be found in your cloud data warehouse documentation:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://docs.snowflake.com/sql-reference/functions-window`,children:`Snowflake window functions`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.snowflake.com/sql-reference/functions/lead`,children:`Lead`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.snowflake.com/en/sql-reference/functions/lag`,children:`Lag`})}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-window-functions`,children:`Databricks window functions`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.databricks.com/aws/en/sql/language-manual/functions/lead`,children:`Lead`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.databricks.com/aws/en/sql/language-manual/functions/lag`,children:`Lag`})}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://docs.aws.amazon.com/redshift/latest/dg/c_Window_functions.html`,children:`Amazon Redshift window functions`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.aws.amazon.com/redshift/latest/dg/r_WF_LEAD.html`,children:`Lead`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.aws.amazon.com/redshift/latest/dg/r_WF_LAG.html`,children:`Lag`})}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://cloud.google.com/bigquery/docs/reference/standard-sql/analytic-function-concepts`,children:`Google BigQuery analytic functions`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions#lead`,children:`Lead`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions#lag`,children:`Lag`})}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`use-case`,children:`Use case`}),`\n`,_jsx(_components.p,{children:`Because Lead/Lag allows you to look forward or backward at other rows in a dataset, it’s helpful in time series and analytical processing. Some common uses for this include:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Calculating changes over time. For example, using `,_jsx(_components.strong,{children:`LAG`}),` to obtain the difference between the current day and the previous day when days are expressed as different rows in the dataset.`]}),`\n`,_jsxs(_components.li,{children:[`Detecting trends and identifying outliers. For example, using `,_jsx(_components.strong,{children:`LEAD`}),` to obtain this month’s spending and compare it to next month’s, and flagging instances where the trend is downward.`]}),`\n`,_jsxs(_components.li,{children:[`Building cumulative or rolling metrics. For example, using multiple `,_jsx(_components.strong,{children:`LAG`}),` functions to obtain data from one day ago, two days ago, and so on.`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`properties`,children:`Properties`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Snowflake`,id:`snowflake`,children:[_jsx(ResponseField,{name:`Name`,type:`string`,required:true,id:`param-name`,children:_jsx(_components.p,{children:`A human-readable name for the component.`})}),_jsx(ResponseField,{name:`Include input columns`,type:`boolean`,required:true,id:`param-include-input-columns`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Yes`}),`, the component passes all input columns into the output.`]})}),_jsxs(ResponseField,{name:`Partition data`,type:`object selector`,id:`param-partition-data`,children:[_jsx(_components.p,{children:`Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.`}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Orderings within partitions`,type:`column editor`,id:`param-orderings-within-partitions`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The input column name for sorting within the partitioned data. You can drag columns to reorder them.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ordering:`}),` The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Functions`,type:`column editor`,required:true,id:`param-functions`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Window Function:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lead:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows after the current row. For more information, read the `,_jsx(_components.a,{href:`https://docs.snowflake.com/sql-reference/functions/lead`,children:`Snowflake Lead`}),` documentation.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lag:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows before the current row. For more information, read the `,_jsx(_components.a,{href:`https://docs.snowflake.com/en/sql-reference/functions/lag`,children:`Snowflake Lag`}),` documentation.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The name of the input column that the Lead/Lag function will retrieve data from.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Offset:`}),` The number of rows to look forward (Lead) or backward (Lag) in the partition.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Output Column:`}),` The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsx(ResponseField,{name:`Ignore nulls`,type:`boolean`,required:true,id:`param-ignore-nulls`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Yes`}),`, disregard null values when determining which row to use. Null values don’t count toward reaching the offset.`]})})]}),_jsxs(Tab,{title:`Databricks`,id:`databricks`,children:[_jsx(ResponseField,{name:`Name`,type:`string`,required:true,id:`param-name-1`,children:_jsx(_components.p,{children:`A human-readable name for the component.`})}),_jsx(ResponseField,{name:`Include input columns`,type:`boolean`,required:true,id:`param-include-input-columns-1`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Yes`}),`, the component passes all input columns into the output.`]})}),_jsxs(ResponseField,{name:`Partition data`,type:`object selector`,id:`param-partition-data-1`,children:[_jsx(_components.p,{children:`Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.`}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Orderings within partitions`,type:`column editor`,id:`param-orderings-within-partitions-1`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The input column name for sorting within the partitioned data. You can drag columns to reorder them.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ordering:`}),` The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Functions`,type:`column editor`,required:true,id:`param-functions-1`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Window Function:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lead:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows after the current row. For more information, read the `,_jsx(_components.a,{href:`https://docs.databricks.com/aws/en/sql/language-manual/functions/lead`,children:`Databricks Lead`}),` documentation.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lag:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows before the current row. For more information, read the `,_jsx(_components.a,{href:`https://docs.databricks.com/aws/en/sql/language-manual/functions/lag`,children:`Databricks Lag`}),` documentation.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The name of the input column that the Lead/Lag function will retrieve data from.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Offset:`}),` The number of rows to look forward (Lead) or backward (Lag) in the partition.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Output Column:`}),` The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsx(ResponseField,{name:`Ignore nulls`,type:`boolean`,required:true,id:`param-ignore-nulls-1`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Yes`}),`, disregard null values when determining which row to use. Null values don’t count toward reaching the offset.`]})})]}),_jsxs(Tab,{title:`Amazon Redshift`,id:`amazon-redshift`,children:[_jsx(ResponseField,{name:`Name`,type:`string`,required:true,id:`param-name-2`,children:_jsx(_components.p,{children:`A human-readable name for the component.`})}),_jsx(ResponseField,{name:`Include input columns`,type:`boolean`,required:true,id:`param-include-input-columns-2`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Yes`}),`, the component passes all input columns into the output.`]})}),_jsxs(ResponseField,{name:`Partition data`,type:`object selector`,id:`param-partition-data-2`,children:[_jsx(_components.p,{children:`Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.`}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Orderings within partitions`,type:`column editor`,id:`param-orderings-within-partitions-2`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The input column name for sorting within the partitioned data. You can drag columns to reorder them.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ordering:`}),` The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Functions`,type:`column editor`,required:true,id:`param-functions-2`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Window Function:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lead:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows after the current row. For more information, read the `,_jsx(_components.a,{href:`https://docs.aws.amazon.com/redshift/latest/dg/r_WF_LEAD.html`,children:`Amazon Redshift Lead`}),` documentation.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lag:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows before the current row. For more information, read the `,_jsx(_components.a,{href:`https://docs.aws.amazon.com/redshift/latest/dg/r_WF_LAG.html`,children:`Amazon Redshift Lag`}),` documentation.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The name of the input column that the Lead/Lag function will retrieve data from.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Offset:`}),` The number of rows to look forward (Lead) or backward (Lag) in the partition.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Output Column:`}),` The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsx(ResponseField,{name:`Ignore nulls`,type:`boolean`,required:true,id:`param-ignore-nulls-2`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Yes`}),`, disregard null values when determining which row to use. Null values don’t count toward reaching the offset.`]})})]}),_jsxs(Tab,{title:`Google BigQuery`,id:`google-bigquery`,children:[_jsx(ResponseField,{name:`Name`,type:`string`,required:true,id:`param-name-3`,children:_jsx(_components.p,{children:`A human-readable name for the component.`})}),_jsx(ResponseField,{name:`Include input columns`,type:`boolean`,required:true,id:`param-include-input-columns-3`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Yes`}),`, the component passes all input columns into the output.`]})}),_jsxs(ResponseField,{name:`Partition data`,type:`object selector`,id:`param-partition-data-3`,children:[_jsx(_components.p,{children:`Select columns to partition the data by. The calculation is then performed on each partition. If you select multiple columns, the data is partitioned by the unique combination of values across all selected columns.`}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Orderings within partitions`,type:`column editor`,id:`param-orderings-within-partitions-3`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The input column name for sorting within the partitioned data. You can drag columns to reorder them.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ordering:`}),` The order of the sorting: Ascending, Descending, Nulls First, or Nulls Last.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]}),_jsxs(ResponseField,{name:`Functions`,type:`column editor`,required:true,id:`param-functions-3`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Window Function:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lead:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows after the current row. For more information, read the `,_jsx(_components.a,{href:`https://cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions#lead`,children:`Google BigQuery Lead`}),` documentation.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lag:`}),` Returns the column from an `,_jsx(_components.strong,{children:`Offset`}),` number of rows before the current row. For more information, read the `,_jsx(_components.a,{href:`https://cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions#lag`,children:`Google BigQuery Lag`}),` documentation.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input Column:`}),` The name of the input column that the Lead/Lag function will retrieve data from.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Offset:`}),` The number of rows to look forward (Lead) or backward (Lag) in the partition.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Output Column:`}),` The name of a column that will be created in the output dataset for the retrieved Lead/Lag data to populate.`]}),`\n`]}),_jsxs(_components.p,{children:[`Toggle `,_jsx(_components.strong,{children:`Text mode`}),` on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read `,_jsx(_components.a,{href:`/docs/guides/components-overview#text-mode`,children:`Text mode`}),`.`]}),_jsxs(_components.p,{children:[`To use grid variables, toggle `,_jsx(_components.strong,{children:`Use Grid Variable`}),` on. For more information, read `,_jsx(_components.a,{href:`/docs/guides/grid-variables`,children:`Grid variables`}),`.`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{ComponentMetadata,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":"Lead/Lag","description":null,"href":"/docs/components/lead-lag"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[153,2672,")=>null;function _cr"]]},"mdxExtracts":{"tableOfContents":[{"title":"Use case","slug":"use-case","depth":3,"children":[]},{"title":"Properties","slug":"properties","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/matillion/1eecfe13cb8a36b9/scripts/feedback-widget.js","/_mintlify/custom/matillion/b8b092d8d394af0f/scripts/ga4-events.js","/_mintlify/custom/matillion/5baf5b38fe34f41f/scripts/iubenda.js","/_mintlify/custom/matillion/573540f1e9142d9c/scripts/kapa-widget.js","/_mintlify/custom/matillion/a52101786f42c23b/scripts/ph-pageleaves.js","/_mintlify/custom/matillion/b8f0431aaf9ef855/scripts/cookie-preferences-button.js","/_mintlify/custom/matillion/a3d31738f4c89949/scripts/status-badge-nav.js","/_mintlify/custom/matillion/b444958fcc79163d/scripts/text-size-slider.js","/_mintlify/custom/matillion/f7016c1e98f77080/scripts/posthog-events.js"],"subdomain":"matillion","siteName":"Maia Documentation","title":"Lead/Lag - Maia Documentation","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"manual"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T18:15:26.586Z","originalFileLocation":"docs/components/lead-lag.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";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=\"light\"}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=\"application-name\" content=\"Maia Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/matillion/eb7R3mt9l7P1vThW/_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/matillion/eb7R3mt9l7P1vThW/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/matillion/eb7R3mt9l7P1vThW/_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/matillion/eb7R3mt9l7P1vThW/_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/matillion/eb7R3mt9l7P1vThW/_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/matillion/eb7R3mt9l7P1vThW/_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/matillion/eb7R3mt9l7P1vThW/_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/matillion/eb7R3mt9l7P1vThW/_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/matillion/eb7R3mt9l7P1vThW/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Lead/Lag - Maia Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Maia Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.maia.ai/docs/components/lead-lag\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://matillion.mintlify.site/_mintlify/api/og/v2?division=Transformation\u0026amp;title=Lead%2FLag\u0026amp;theme=ce57a3e3dfd574362d42229a\u0026amp;signature=42c6fe78b8033690adb132491e20761c26c9a132a49de11fd389ef77d5a636bf\">\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=\"Lead/Lag - Maia Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://matillion.mintlify.site/_mintlify/api/og/v2?division=Transformation\u0026amp;title=Lead%2FLag\u0026amp;theme=ce57a3e3dfd574362d42229a\u0026amp;signature=42c6fe78b8033690adb132491e20761c26c9a132a49de11fd389ef77d5a636bf\">\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/matillion/eb7R3mt9l7P1vThW/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Maia Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#001f1d\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"0VLXGRESICGHnU66TdhEgUMBRRubPnW8JTkzOpiiNn0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.maia.ai/docs/components/lead-lag\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/components/lead-lag.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.maia.ai/#organization\",\"name\":\"Maia Documentation\",\"url\":\"https://docs.maia.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/matillion/GyuNBHAx-GXnVlKX/images/maia-by-matillion-light.svg?fit=max\u0026auto=format\u0026n=GyuNBHAx-GXnVlKX\u0026q=85\u0026s=2c48b854f858c5a835450b3f34360db7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.maia.ai#website\",\"name\":\"Maia Documentation\",\"url\":\"https://docs.maia.ai\",\"publisher\":{\"@id\":\"https://docs.maia.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.maia.ai/docs/components/lead-lag#webpage\",\"url\":\"https://docs.maia.ai/docs/components/lead-lag\",\"name\":\"Lead/Lag\",\"dateModified\":\"2026-11-12T18:15:26.586Z\",\"isPartOf\":{\"@id\":\"https://docs.maia.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.maia.ai/docs/components/lead-lag#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.maia.ai/docs/components/lead-lag#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Transformation\",\"item\":\"https://docs.maia.ai/docs/components/transformation-pipeline-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lead/Lag\",\"item\":\"https://docs.maia.ai/docs/components/lead-lag\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.maia.ai/docs/components/lead-lag#article\",\"headline\":\"Lead/Lag\",\"name\":\"Lead/Lag\",\"url\":\"https://docs.maia.ai/docs/components/lead-lag\",\"mainEntityOfPage\":{\"@id\":\"https://docs.maia.ai/docs/components/lead-lag#webpage\"},\"dateModified\":\"2026-11-12T18:15:26.586Z\",\"publisher\":{\"@id\":\"https://docs.maia.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.maia.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Maia Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Maia Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/components/lead-lag.md","siteName":"Maia Documentation","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":""}]},{"tab":"Admin","pages":[{"title":"Admin","href":"/docs/administration/administration-overview"}]},{"tab":"Components","pages":[{"title":"Components overview","href":"/docs/components/components-overview"},{"group":"Connectors","root":{"title":"Connectors overview","href":"/docs/components/connectors-overview"},"pages":[{"title":"Connectors overview","href":"/docs/components/connectors-overview"},{"title":"Custom connectors in Designer","href":"/docs/components/custom-connector"},{"title":"System tables","href":"/docs/guides/system-tables-example"},{"group":"Connector authentication guides","root":{"title":"Connector authentication","href":"/docs/guides/connector-authentication-overview"},"pages":[{"title":"Connector authentication","href":"/docs/guides/connector-authentication-overview"},{"title":"HubSpot authentication guide","href":"/docs/guides/hubspot-authentication-guide"},{"title":"Jira authentication guide","href":"/docs/guides/jira-authentication-guide"},{"title":"LinkedIn Ads authentication guide","href":"/docs/guides/linkedin-ads-authentication-guide"},{"title":"Kafka authentication guide","href":"/docs/guides/kafka-authentication-guide"},{"title":"Marketo authentication guide","href":"/docs/guides/marketo-authentication-guide"},{"title":"Microsoft Fabric Lakehouse authentication guide","href":"/docs/guides/microsoft-fabric-lakehouse-authentication-guide"},{"title":"NetSuite Query authentication guide","href":"/docs/guides/netsuite-query-authentication-guide"},{"title":"NetSuite SuiteAnalytics authentication guide","href":"/docs/guides/netsuite-suiteanalytics-authentication-guide"},{"title":"Oracle Autonomous Database authentication guide","href":"/docs/guides/oracle-autonomous-database-authentication-guide"},{"title":"Salesforce authentication guide","href":"/docs/guides/salesforce-authentication-guide"},{"title":"ServiceNow authentication guide","href":"/docs/guides/servicenow-authentication-guide"},{"title":"Workday authentication guide","href":"/docs/guides/workday-authentication-guide"}]},{"title":"ActiveCampaign","href":"/docs/components/activecampaign"},{"title":"Amazon DynamoDB Load","href":"/docs/components/amazon-dynamodb-load"},{"title":"Amazon Redshift Load","href":"/docs/components/amazon-redshift-load"},{"title":"Amplitude","href":"/docs/components/amplitude"},{"title":"Anaplan","href":"/docs/components/anaplan"},{"title":"Asana","href":"/docs/components/asana"},{"title":"Attio","href":"/docs/components/attio"},{"title":"AVRO Load","href":"/docs/components/avro-load"},{"title":"Azure Blob Storage Load","href":"/docs/components/azure-blob-storage-load"},{"title":"Azure Blob Storage Unload","href":"/docs/components/azure-blob-storage-unload"},{"title":"Azure Cosmos DB for NoSQL","href":"/docs/components/azure-cosmos-db-for-nosql"},{"title":"Azure SQL","href":"/docs/components/azure-sql"},{"title":"Bing Ads Load","href":"/docs/components/bing-ads-load"},{"title":"Bing Ads Query (deprecated)","href":"/docs/components/bing-ads-query"},{"title":"Box","href":"/docs/components/box"},{"title":"Braze","href":"/docs/components/braze"},{"title":"Brevo","href":"/docs/components/brevo"},{"title":"Bugcrowd","href":"/docs/components/bugcrowd"},{"title":"Buildkite","href":"/docs/components/buildkite"},{"title":"Chargebee","href":"/docs/components/chargebee"},{"title":"CircleCI","href":"/docs/components/circleci"},{"title":"ClickUp","href":"/docs/components/clickup"},{"title":"Coalesce","href":"/docs/components/coalesce"},{"title":"Concord","href":"/docs/components/concord"},{"title":"Confluence","href":"/docs/components/confluence"},{"title":"CSV Load","href":"/docs/components/csv-load"},{"title":"Data Transfer","href":"/docs/components/data-transfer"},{"title":"Database Query","href":"/docs/components/database-query"},{"title":"Databricks","href":"/docs/components/databricks"},{"title":"Datadog","href":"/docs/components/datadog"},{"title":"dbt Cloud","href":"/docs/components/dbt-cloud"},{"title":"Delighted","href":"/docs/components/delighted"},{"title":"Dixa","href":"/docs/components/dixa"},{"title":"Dropbox","href":"/docs/components/dropbox"},{"title":"Dynamics 365 Business Central","href":"/docs/components/dynamics-365-business-central"},{"title":"Elasticsearch Load","href":"/docs/components/elasticsearch-load"},{"title":"Email Load","href":"/docs/components/email-load"},{"title":"Eventbrite","href":"/docs/components/eventbrite"},{"title":"Excel Load","href":"/docs/components/excel-load"},{"title":"Excel Query","href":"/docs/components/excel-query"},{"title":"Facebook Ads","href":"/docs/components/facebook-ads"},{"title":"Facebook Ads Query (deprecated)","href":"/docs/components/facebook-ads-query"},{"title":"Facebook Ads Query example configurations","href":"/docs/guides/facebook-ads-query-example"},{"title":"Facebook Load","href":"/docs/components/facebook-load"},{"title":"Facebook Query (deprecated)","href":"/docs/components/facebook-query"},{"title":"Fanatics","href":"/docs/components/fanatics"},{"title":"FireHydrant","href":"/docs/components/firehydrant"},{"title":"Float","href":"/docs/components/flex-float"},{"title":"Freshdesk","href":"/docs/components/freshdesk"},{"title":"GitHub","href":"/docs/components/github"},{"title":"Gmail","href":"/docs/components/gmail"},{"title":"Gong","href":"/docs/components/gong"},{"title":"Google Ads Load","href":"/docs/components/google-ads-load"},{"title":"Google Analytics","href":"/docs/components/google-analytics"},{"title":"Google Analytics Query (deprecated)","href":"/docs/components/google-analytics-query"},{"title":"Google BigQuery (connector)","href":"/docs/components/google-bigquery"},{"title":"Google BigQuery Load","href":"/docs/components/google-bigquery-load"},{"title":"Google Cloud Storage Unload","href":"/docs/components/google-cloud-storage-unload"},{"title":"Google Sheets","href":"/docs/components/google-sheets"},{"title":"HubSpot Load","href":"/docs/components/hubspot-load"},{"title":"HubSpot Query (deprecated)","href":"/docs/components/hubspot-query"},{"title":"IBM Db2 for i Load","href":"/docs/components/ibm-db2-load"},{"title":"Infobip","href":"/docs/components/infobip"},{"title":"Intercom","href":"/docs/components/intercom"},{"title":"JDBC Load","href":"/docs/components/jdbc-load"},{"title":"Jira Load","href":"/docs/components/jira-load"},{"title":"Jotform","href":"/docs/components/jotform"},{"title":"JSON Load","href":"/docs/components/json-load"},{"title":"Kafka","href":"/docs/components/kafka"},{"title":"Klaviyo","href":"/docs/components/klaviyo"},{"title":"LaunchDarkly","href":"/docs/components/launchdarkly"},{"title":"LDAP Load","href":"/docs/components/ldap-load"},{"title":"LDAP Query (deprecated)","href":"/docs/components/ldap-query"},{"title":"LinkedIn Ads","href":"/docs/components/linkedin-ads"},{"title":"Lob","href":"/docs/components/lob"},{"title":"Maia Flex connector","href":"/docs/components/maia-flex-connector"},{"title":"Mailchimp","href":"/docs/components/mailchimp"},{"title":"Mailgun","href":"/docs/components/mailgun"},{"title":"Mandrill","href":"/docs/components/mandrill"},{"title":"MariaDB Load","href":"/docs/components/mariadb-load"},{"title":"MariaDB Unload","href":"/docs/components/mariadb-unload"},{"title":"Marketo Load","href":"/docs/components/marketo-load"},{"title":"Microsoft Dataverse","href":"/docs/components/microsoft-dataverse"},{"title":"Microsoft Dynamics 365 Load","href":"/docs/components/microsoft-dynamics-365-load"},{"title":"Microsoft Dynamics CRM Load","href":"/docs/components/microsoft-dynamics-crm-load"},{"title":"Microsoft Exchange","href":"/docs/components/microsoft-exchange"},{"title":"Microsoft SQL Server Load","href":"/docs/components/microsoft-sql-server-load"},{"title":"Mixpanel","href":"/docs/components/mixpanel"},{"title":"MongoDB Load","href":"/docs/components/mongodb-load"},{"title":"NetSuite Query","href":"/docs/components/netsuite-query"},{"title":"NetSuite SuiteAnalytics (deprecated)","href":"/docs/components/netsuite-suiteanalytics"},{"title":"NetSuite SuiteAnalytics Load","href":"/docs/components/netsuite-suiteanalytics-load"},{"title":"New Relic","href":"/docs/components/new-relic"},{"title":"Notion","href":"/docs/components/notion"},{"title":"OData","href":"/docs/components/odata"},{"title":"OData Query","href":"/docs/components/odata-query"},{"title":"Ongoing WMS","href":"/docs/components/ongoing-wms"},{"title":"Open Exchange Rates","href":"/docs/components/open-exchange-rates"},{"title":"Oracle Eloqua Load","href":"/docs/components/oracle-eloqua-load"},{"title":"Oracle Fusion Cloud Financials Load","href":"/docs/components/oracle-fcf-load"},{"title":"Oracle Fusion Cloud HCM Load","href":"/docs/components/oracle-hcm-load"},{"title":"Oracle Fusion Cloud Procurement Load","href":"/docs/components/oracle-fcp-load"},{"title":"Oracle Fusion Cloud Project Management Load","href":"/docs/components/oracle-fcpm-load"},{"title":"Oracle Load","href":"/docs/components/oracle-load"},{"title":"Oracle Output","href":"/docs/components/oracle-output"},{"title":"Oracle Unload","href":"/docs/components/oracle-unload"},{"title":"Orbit","href":"/docs/components/orbit"},{"title":"ORC Load","href":"/docs/components/orc-load"},{"title":"Ortto","href":"/docs/components/ortto"},{"title":"PagerDuty","href":"/docs/components/pagerduty"},{"title":"Parquet Load","href":"/docs/components/parquet-load"},{"title":"PayPal","href":"/docs/components/paypal"},{"title":"Pendo","href":"/docs/components/pendo"},{"title":"Persona","href":"/docs/components/persona"},{"title":"Pingdom","href":"/docs/components/pingdom"},{"title":"Pipedrive","href":"/docs/components/pipedrive"},{"title":"PostgreSQL Load","href":"/docs/components/postgresql-load"},{"title":"PostgreSQL Unload","href":"/docs/components/postgresql-unload"},{"title":"Productboard","href":"/docs/components/productboard"},{"title":"RDS Query","href":"/docs/components/rds-query"},{"title":"Recurly","href":"/docs/components/recurly"},{"title":"RingCentral","href":"/docs/components/ringcentral"},{"title":"Rootly","href":"/docs/components/rootly"},{"title":"S3 Load","href":"/docs/components/s3-load"},{"title":"S3 Unload","href":"/docs/components/s3-unload"},{"title":"Sage Intacct Load","href":"/docs/components/sage-intacct-load"},{"title":"Salesforce Load","href":"/docs/components/salesforce-load"},{"title":"Salesforce Marketing Cloud Query","href":"/docs/components/salesforce-marketing-cloud-query"},{"title":"Salesforce Pardot","href":"/docs/components/salesforce-pardot"},{"title":"Salesforce Query (deprecated)","href":"/docs/components/salesforce-query"},{"title":"Salesloft","href":"/docs/components/salesloft"},{"title":"SAP NetWeaver (deprecated)","href":"/docs/components/sap-netweaver"},{"title":"SAP NetWeaver Load","href":"/docs/components/sap-netweaver-load"},{"title":"SAP ODP","href":"/docs/components/sap-odp"},{"title":"SAP SuccessFactors","href":"/docs/components/sap-successfactors"},{"title":"SeatGeek","href":"/docs/components/seatgeek"},{"title":"SendGrid","href":"/docs/components/sendgrid"},{"title":"ServiceNow Load","href":"/docs/components/servicenow-load"},{"title":"ServiceNow Query","href":"/docs/components/servicenow-query"},{"title":"SharePoint Load","href":"/docs/components/sharepoint-load"},{"title":"SharePoint Query (deprecated)","href":"/docs/components/sharepoint-query"},{"title":"Shopify","href":"/docs/components/shopify"},{"title":"Shopify Load","href":"/docs/components/shopify-load"},{"title":"Slack","href":"/docs/components/slack"},{"title":"Smartsheet","href":"/docs/components/smartsheet"},{"title":"Snapchat","href":"/docs/components/snapchat"},{"title":"Snowflake Load","href":"/docs/components/snowflake-load"},{"title":"Snyk","href":"/docs/components/snyk"},{"title":"Square","href":"/docs/components/square"},{"title":"Stripe Load","href":"/docs/components/stripe-load"},{"title":"Stripe Query (deprecated)","href":"/docs/components/stripe-query"},{"title":"SugarCRM Load","href":"/docs/components/sugarcrm-load"},{"title":"SurveyMonkey","href":"/docs/components/surveymonkey"},{"title":"Sybase ASE Load","href":"/docs/components/sybase-ase-load"},{"title":"Ticketmaster","href":"/docs/components/ticketmaster"},{"title":"TikTok","href":"/docs/components/tiktok"},{"title":"Toggl","href":"/docs/components/toggl"},{"title":"Twilio","href":"/docs/components/twilio"},{"title":"Unstructured.io","href":"/docs/components/unstructured"},{"title":"Workday","href":"/docs/components/workday"},{"title":"Workday Custom Reports","href":"/docs/components/workday-custom-reports"},{"title":"Workday Load","href":"/docs/components/workday-load"},{"title":"X Ads Load","href":"/docs/components/x-ads-load"},{"title":"Yelp","href":"/docs/components/yelp"},{"title":"Zendesk Talk","href":"/docs/components/zendesk-talk"},{"title":"Zendesk Ticketing","href":"/docs/components/zendesk-ticketing"},{"title":"Zoom","href":"/docs/components/zoom"},{"title":"Zoho CRM Load","href":"/docs/components/zoho-crm-load"},{"title":"Zuora","href":"/docs/components/zuora"},{"title":"Zuora Bulk","href":"/docs/components/zuora-bulk"}]},{"group":"Orchestration","root":{"title":"Orchestration overview","href":"/docs/components/orchestration-pipeline-overview"},"pages":[{"title":"Orchestration overview","href":"/docs/components/orchestration-pipeline-overview"},{"group":"Pipeline control","root":{"title":"Pipeline control components","href":"/docs/components/pipeline-control-components"},"pages":[{"title":"Pipeline control components","href":"/docs/components/pipeline-control-components"},{"title":"And component","href":"/docs/components/and"},{"title":"Begin transaction","href":"/docs/components/begin"},{"title":"Commit transaction","href":"/docs/components/commit"},{"title":"End Failure","href":"/docs/components/end-failure"},{"title":"End Success","href":"/docs/components/end-success"},{"title":"If component","href":"/docs/components/if"},{"title":"Or component","href":"/docs/components/or"},{"title":"Retry","href":"/docs/components/retry"},{"title":"Rollback transaction","href":"/docs/components/rollback"},{"title":"Run Orchestration","href":"/docs/components/run-orchestration"},{"title":"Run Shared Pipeline","href":"/docs/components/run-shared-pipeline"},{"title":"Run Transformation","href":"/docs/components/run-transformation"},{"title":"Start component","href":"/docs/components/start"},{"title":"Start Compute","href":"/docs/components/start-compute"}]},{"group":"DDL","root":{"title":"DDL components","href":"/docs/components/ddl-components"},"pages":[{"title":"DDL components","href":"/docs/components/ddl-components"},{"title":"Add Partition","href":"/docs/components/add-partition"},{"title":"Alter Table","href":"/docs/components/alter-table"},{"title":"Alter Warehouse","href":"/docs/components/alter-warehouse"},{"title":"Analyze Tables","href":"/docs/components/analyze-tables"},{"title":"Create External Table","href":"/docs/components/create-external-table"},{"title":"Create File Format","href":"/docs/components/create-file-format"},{"title":"Create Stream","href":"/docs/components/create-stream"},{"title":"Create Table","href":"/docs/components/create-table"},{"title":"Delete Tables","href":"/docs/components/delete-tables"},{"title":"Google Drive Table","href":"/docs/components/google-drive-table"},{"title":"Optimize","href":"/docs/components/optimize"},{"title":"Refresh External Table","href":"/docs/components/refresh-external-table"},{"title":"Refresh Materialized View","href":"/docs/components/refresh-materialized-view"},{"title":"Refresh Table","href":"/docs/components/refresh-table"},{"title":"Schema Copy","href":"/docs/components/schema-copy"},{"title":"Truncate Table","href":"/docs/components/truncate-table"},{"title":"Vacuum","href":"/docs/components/vacuum"},{"title":"Volume to Delta Table","href":"/docs/components/volume-to-delta-table"}]},{"group":"Scripting","root":{"title":"Scripting components","href":"/docs/components/scripting-components"},"pages":[{"title":"Scripting components","href":"/docs/components/scripting-components"},{"title":"dbt Core","href":"/docs/components/dbt-core"},{"title":"Python Pushdown","href":"/docs/components/python-pushdown"},{"title":"Python Script","href":"/docs/components/python-script"},{"title":"Run Notebook","href":"/docs/components/run-notebook"},{"title":"Script Pushdown","href":"/docs/components/script-pushdown"},{"title":"SQL Script","href":"/docs/components/sql-script"}]},{"group":"AI","root":{"title":"AI components","href":"/docs/components/ai-components"},"pages":[{"title":"AI components","href":"/docs/components/ai-components"},{"title":"Amazon Bedrock Prompt","href":"/docs/components/amazon-bedrock-prompt"},{"title":"Amazon Textract Input","href":"/docs/components/amazon-textract-input"},{"title":"Amazon Transcribe Input","href":"/docs/components/amazon-transcribe-input"},{"title":"Azure Document Intelligence","href":"/docs/components/azure-document-intelligence"},{"title":"Azure OpenAI Prompt","href":"/docs/components/azure-openai-prompt"},{"title":"OpenAI Prompt","href":"/docs/components/openai-prompt"},{"title":"Azure Speech Transcribe","href":"/docs/components/azure-speech-transcribe"},{"title":"Chunk Text","href":"/docs/components/chunk-text"},{"title":"Cortex Finetune","href":"/docs/components/cortex-finetune"},{"title":"Pinecone Vector Query","href":"/docs/components/pinecone-vector-query"},{"title":"Snowpark Container Prompt","tag":"Preview","href":"/docs/components/snowpark-container-prompt"},{"title":"How to create an app in Snowpark Container Services","tag":"Preview","href":"/docs/guides/snowpark-container-app-how-to"},{"title":"TypeSafe Decide","href":"/docs/components/typesafe-decide"},{"title":"Google Vertex AI Prompt","href":"/docs/components/vertex-ai-prompt"}]},{"group":"Variables","root":{"title":"Variables components","href":"/docs/components/variables-components"},"pages":[{"title":"Variables components","href":"/docs/components/variables-components"},{"title":"Append to Grid","href":"/docs/components/append-to-grid"},{"title":"Assert Scalar Variables","href":"/docs/components/assert-scalar-variables"},{"title":"JDBC Table Metadata to Grid","href":"/docs/components/jdbc-table-metadata-to-grid"},{"title":"Print Variables","href":"/docs/components/print-variables"},{"title":"Query Result To Grid","href":"/docs/components/query-result-to-grid"},{"title":"Query Result To Scalar","href":"/docs/components/query-result-to-scalar"},{"title":"Remove from Grid","href":"/docs/components/remove-from-grid"},{"title":"Show to Grid","href":"/docs/components/show-to-grid"},{"title":"Table Metadata to Grid","href":"/docs/components/table-metadata-to-grid"},{"title":"Update Scalar","href":"/docs/components/update-scalar"}]},{"group":"Messaging","root":{"title":"Messaging components","href":"/docs/components/messaging-components"},"pages":[{"title":"Messaging components","href":"/docs/components/messaging-components"},{"title":"Azure Queue Storage Message","href":"/docs/components/azure-queue-storage-message"},{"title":"CloudWatch Publish","href":"/docs/components/cloudwatch-publish"},{"title":"Cloud Pub/Sub","href":"/docs/components/pubsub"},{"title":"Send Email","href":"/docs/components/send-email"},{"title":"SNS Message","href":"/docs/components/sns-message"},{"title":"SQS Message","href":"/docs/components/sqs-message"},{"title":"Webhook Post","href":"/docs/components/webhook-post"}]},{"group":"Assert","root":{"title":"Assert components","href":"/docs/components/assert-components"},"pages":[{"title":"Assert components","href":"/docs/components/assert-components"},{"title":"Assert External Table","href":"/docs/components/assert-external-table"},{"title":"Assert Scalar Variables","href":"/docs/components/assert-scalar-variables"},{"title":"Assert Table","href":"/docs/components/assert-table"}]},{"group":"Metadata","root":{"title":"Metadata components","href":"/docs/components/metadata-components"},"pages":[{"title":"Metadata components","href":"/docs/components/metadata-components"},{"title":"JDBC Table Metadata to Grid","href":"/docs/components/jdbc-table-metadata-to-grid"},{"title":"Table Metadata to Grid","href":"/docs/components/table-metadata-to-grid"}]},{"group":"Iterators","root":{"title":"Iterator components","href":"/docs/guides/iterator-components"},"pages":[{"title":"Iterator components","href":"/docs/guides/iterator-components"},{"title":"File Iterator","href":"/docs/components/file-iterator"},{"title":"Fixed Iterator","href":"/docs/components/fixed-iterator"},{"title":"Grid Iterator","href":"/docs/components/grid-iterator"},{"title":"Loop Iterator","href":"/docs/components/loop-iterator"},{"title":"Table Iterator","href":"/docs/components/table-iterator"}]},{"group":"Output and upsert","root":{"title":"Output and upsert components","href":"/docs/components/output-and-upsert-components"},"pages":[{"title":"Output and upsert components","href":"/docs/components/output-and-upsert-components"},{"title":"Amazon OpenSearch Upsert","href":"/docs/components/amazon-opensearch-upsert"},{"title":"Pinecone Vector Upsert","href":"/docs/components/pinecone-vector-upsert"},{"title":"Postgres Vector Upsert","href":"/docs/components/postgres-vector-upsert"},{"title":"RDS Bulk Output","href":"/docs/components/rds-bulk-output"},{"title":"Microsoft SQL Server Output","href":"/docs/components/sql-server-output"},{"title":"Salesforce Output","href":"/docs/components/salesforce-output"},{"title":"Snowflake Vector Upsert","href":"/docs/components/snowflake-vector-upsert"}]}]},{"group":"Transformation","root":{"title":"Transformation overview","href":"/docs/components/transformation-pipeline-overview"},"pages":[{"title":"Transformation overview","href":"/docs/components/transformation-pipeline-overview"},{"title":"Aggregate","href":"/docs/components/aggregate"},{"title":"Assert View","href":"/docs/components/assert-view"},{"title":"Calculator","href":"/docs/components/calculator"},{"title":"Construct Struct","href":"/docs/components/construct-struct"},{"title":"Construct Variant","href":"/docs/components/construct-variant"},{"title":"Convert String To Struct","href":"/docs/components/convert-string-to-struct"},{"title":"Convert Type","href":"/docs/components/convert-type"},{"group":"Cortex","pages":[{"title":"Cortex Completions","href":"/docs/components/cortex-completions"},{"title":"Cortex Embed","href":"/docs/components/cortex-embed"},{"title":"Cortex Extract Answer","href":"/docs/components/cortex-extract-answer"},{"title":"Cortex Multi Prompt","href":"/docs/components/cortex-multi-prompt"},{"title":"Cortex Parse Document","tag":"Preview","href":"/docs/components/cortex-parse-document"},{"title":"Cortex Sentiment","href":"/docs/components/cortex-sentiment"},{"title":"Cortex Summarize","href":"/docs/components/cortex-summarize"},{"title":"Cortex Translate","href":"/docs/components/cortex-translate"}]},{"title":"Create View","href":"/docs/components/create-view"},{"title":"Data Cleanse","href":"/docs/components/data-cleanse"},{"group":"Databricks AI","pages":[{"title":"AI Analyze Sentiment","href":"/docs/components/databricks-ai-analyze-sentiment"},{"title":"AI Classify","href":"/docs/components/databricks-ai-classify"},{"title":"AI Extract","href":"/docs/components/databricks-ai-extract"},{"title":"AI Fix Grammar","href":"/docs/components/databricks-ai-fix-grammar"},{"title":"AI Mask","href":"/docs/components/databricks-ai-mask"},{"title":"AI Query","href":"/docs/components/databricks-ai-query"},{"title":"AI Similarity","href":"/docs/components/databricks-ai-similarity"},{"title":"AI Summarize","href":"/docs/components/databricks-ai-summarize"},{"title":"AI Translate","href":"/docs/components/databricks-ai-translate"},{"title":"Databricks Vector Search","href":"/docs/components/databricks-vector-search"}]},{"title":"Detect Changes","href":"/docs/components/detect-changes"},{"title":"Distinct","href":"/docs/components/distinct"},{"title":"Document AI Predict","tag":"Preview","href":"/docs/components/document-ai-predict"},{"title":"Except","href":"/docs/components/except"},{"title":"Extract Nested Data","href":"/docs/components/extract-nested-data"},{"title":"Extract Structured Data","href":"/docs/components/extract-structured-data"},{"title":"Filter","href":"/docs/components/filter"},{"title":"First/Last","href":"/docs/components/first-last"},{"title":"Fixed Flow","href":"/docs/components/fixed-flow"},{"title":"Flatten Variant","href":"/docs/components/flatten-variant"},{"title":"Generate Sequence","href":"/docs/components/generate-sequence"},{"group":"Google BigQuery AI","pages":[{"title":"Check Condition","href":"/docs/components/bigquery-check-condition"},{"title":"Classify","href":"/docs/components/bigquery-classify"},{"title":"Embed","href":"/docs/components/bigquery-embed"},{"title":"Generate","href":"/docs/components/bigquery-generate"},{"title":"Score","href":"/docs/components/bigquery-score"},{"title":"Vector Search","href":"/docs/components/bigquery-vector-search"}]},{"title":"Intersect","href":"/docs/components/intersect"},{"title":"Join","description":null,"href":"/docs/components/join"},{"title":"Lead/Lag","href":"/docs/components/lead-lag"},{"title":"Map Values","description":null,"href":"/docs/components/map-values"},{"title":"ML Classification","tag":"Preview","href":"/docs/components/ml-classification-sf"},{"title":"Multi Table Input","href":"/docs/components/multi-table-input"},{"title":"Pivot","href":"/docs/components/pivot"},{"title":"Rank","href":"/docs/components/rank"},{"title":"Rename","href":"/docs/components/rename"},{"title":"Rewrite Table","href":"/docs/components/rewrite-table"},{"title":"Split field","href":"/docs/components/split-field"},{"title":"SQL","href":"/docs/components/sql"},{"title":"Stream Input","href":"/docs/components/stream-input"},{"title":"Table Delete Rows","href":"/docs/components/table-delete-rows"},{"title":"Table Input","href":"/docs/components/table-input"},{"title":"Table Output","href":"/docs/components/table-output"},{"title":"Table Update","href":"/docs/components/table-update"},{"title":"Transpose Columns","href":"/docs/components/transpose-columns"},{"title":"Transpose Rows","href":"/docs/components/transpose-rows"},{"title":"Unite","href":"/docs/components/unite"},{"title":"Unpivot","href":"/docs/components/unpivot"},{"title":"Vector Search","href":"/docs/components/vector-search"},{"title":"Wildcard Table Input","href":"/docs/components/wildcard-table-input"},{"title":"Window Calculation","href":"/docs/components/window-calculation"}]},{"group":"Test pipelines","root":{"title":"Test pipelines","href":"/docs/components/test-pipelines"},"pages":[{"title":"Test pipelines","href":"/docs/components/test-pipelines"},{"title":"Assert Table Values","href":"/docs/components/assert-table-values"},{"title":"Compare Table Values","href":"/docs/components/compare-table-values"},{"title":"Create Table From Values","href":"/docs/components/create-table-from-values"},{"title":"Run Pipeline To Test","href":"/docs/components/run-pipeline-to-test"},{"title":"Zero Copy Clone","href":"/docs/components/zero-copy-clone"}]}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/docs/guides/maia-overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/docs/api-reference/maia-api-overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/docs/changelog/2026-changelog"}]}]},"basePath":"","title":"Lead/Lag - Maia Documentation","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}