1"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[821],{7961:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>d,default:()=>o,frontMatter:()=>t,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"check-types/min","title":"Min Check","description":"The min check validates the minimum value of a numeric column. This check helps ensure data quality by validating that the smallest values in your dataset meet expectations.","source":"@site/docs/check-types/min.md","sourceDirName":"check-types","slug":"/check-types/min","permalink":"/docs/check-types/min","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Sum Check","permalink":"/docs/check-types/sum"},"next":{"title":"Max Check","permalink":"/docs/check-types/max"}}');var l=i(4848),r=i(8453);const t={},d="Min Check",a={},c=[{value:"Configuration",id:"configuration",level:2},{value:"Examples",id:"examples",level:2},{value:"Basic Min Check",id:"basic-min-check",level:3},{value:"Min with Filter",id:"min-with-filter",level:3},{value:"Min by Dimensions",id:"min-by-dimensions",level:3},{value:"Min with Time Dimension",id:"min-with-time-dimension",level:3},{value:"Use Cases",id:"use-cases",level:2},{value:"Generated SQL",id:"generated-sql",level:2},{value:"Example Results",id:"example-results",level:2},{value:"Data Types",id:"data-types",level:2},{value:"NULL Handling",id:"null-handling",level:2},{value:"Common Patterns",id:"common-patterns",level:2},{value:"Price Validation",id:"price-validation",level:3},{value:"Date Range Validation",id:"date-range-validation",level:3},{value:"Performance Metrics",id:"performance-metrics",level:3},{value:"Performance Tips",id:"performance-tips",level:2},{value:"Related Checks",id:"related-checks",level:2}];function h(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsx)(n.h1,{id:"min-check",children:"Min Check"})}),"\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"min"})," check validates the minimum value of a numeric column. This check helps ensure data quality by validating that the smallest values in your dataset meet expectations."]}),"\n",(0,l.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Parameter"}),(0,l.jsx)(n.th,{children:"Required"}),(0,l.jsx)(n.th,{children:"Description"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"name"})}),(0,l.jsx)(n.td,{children:"Yes"}),(0,l.jsx)(n.td,{children:"Unique name for the check"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"dataset"})}),(0,l.jsx)(n.td,{children:"Yes"}),(0,l.jsx)(n.td,{children:"Table name or SQL query"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"type"})}),(0,l.jsx)(n.td,{children:"Yes"}),(0,l.jsxs)(n.td,{children:["Must be ",(0,l.jsx)(n.code,{children:"min"})]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"measure"})}),(0,l.jsx)(n.td,{children:"Yes"}),(0,l.jsx)(n.td,{children:"Column name to find minimum"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"condition"})}),(0,l.jsx)(n.td,{children:"Yes"}),(0,l.jsx)(n.td,{children:"Comparison operator"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"threshold"})}),(0,l.jsx)(n.td,{children:"Yes"}),(0,l.jsx)(n.td,{children:"Value to compare against"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"dimensions"})}),(0,l.jsx)(n.td,{children:"No"}),(0,l.jsx)(n.td,{children:"Group by columns"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"filter"})}),(0,l.jsx)(n.td,{children:"No"}),(0,l.jsx)(n.td,{children:"WHERE clause conditions"})]})]})]}),"\n",(0,l.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,l.jsx)(n.h3,{id:"basic-min-check",children:"Basic Min Check"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:"- name: minimum_order_amount\n dataset: orders\n type: min\n measure: order_amount\n condition: ge\n threshold: 1.0\n"})}),"\n",(0,l.jsx)(n.p,{children:"This check ensures the smallest order is at least $1."}),"\n",(0,l.jsx)(n.h3,{id:"min-with-filter",children:"Min with Filter"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:"- name: min_product_price\n dataset: products\n type: min\n measure: price\n condition: gt\n threshold: 0\n filter: status = 'active'\n"})}),"\n",(0,l.jsx)(n.p,{children:"This check validates that all active products have a price greater than 0."}),"\n",(0,l.jsx)(n.h3,{id:"min-by-dimensions",children:"Min by Dimensions"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:"- name: min_salary_by_department\n dataset: employees\n type: min\n measure: salary\n dimensions: [department]\n condition: ge\n threshold: 30000\n"})}),"\n",(0,l.jsx)(n.p,{children:"This check ensures minimum salary in each department is at least $30K."}),"\n",(0,l.jsx)(n.h3,{id:"min-with-time-dimension",children:"Min with Time Dimension"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:"- name: daily_min_temperature\n dataset: sensor_readings\n type: min\n measure: temperature\n
1condition: gt\n threshold: -40\n time_dimension:\n name: reading_date\n granularity: day\n"})}),"\n",(0,l.jsx)(n.p,{children:"This check validates daily minimum temperature is above -40\xb0."}),"\n",(0,l.jsx)(n.h2,{id:"use-cases",children:"Use Cases"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Data Quality"}),": Ensure no unreasonably low values"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Business Rules"}),": Validate minimum acceptable values"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Range Validation"}),": Check lower bounds of data ranges"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Outlier Detection"}),": Identify potentially problematic minimum values"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Compliance"}),": Ensure minimum standards are met"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"generated-sql",children:"Generated SQL"}),"\n",(0,l.jsx)(n.p,{children:"The min check generates SQL like:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-sql",children:"SELECT MIN(order_amount)\nFROM orders\nWHERE status = 'completed'\n"})}),"\n",(0,l.jsx)(n.p,{children:"With dimensions:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-sql",children:"SELECT department, MIN(salary)\nFROM employees\nGROUP BY department\n"})}),"\n",(0,l.jsx)(n.h2,{id:"example-results",children:"Example Results"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{children:"\u2713 minimum_order_amount: 5.50 (\u2265 1.0)\n\u2717 min_product_price: 0.00 (> 0)\n\u2713 min_salary_by_department_engineering: 65000 (\u2265 30000)\n\u2713 min_salary_by_department_sales: 35000 (\u2265 30000)\n"})}),"\n",(0,l.jsx)(n.h2,{id:"data-types",children:"Data Types"}),"\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"measure"})," column should be numeric or comparable. Common types include:"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"INTEGER"})}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"DECIMAL"})," / ",(0,l.jsx)(n.code,{children:"NUMERIC"})]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"FLOAT"})," / ",(0,l.jsx)(n.code,{children:"DOUBLE"})]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"DATE"})," / ",(0,l.jsx)(n.code,{children:"TIMESTAMP"})]}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"TIME"})}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"null-handling",children:"NULL Handling"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"MIN()"})," ignores NULL values automatically"]}),"\n",(0,l.jsxs)(n.li,{children:["If all values are NULL, ",(0,l.jsx)(n.code,{children:"MIN()"})," returns NULL"]}),"\n",(0,l.jsx)(n.li,{children:"The check will fail if MIN() returns NULL (unless specifically handled)"}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"common-patterns",children:"Common Patterns"}),"\n",(0,l.jsx)(n.h3,{id:"price-validation",children:"Price Validation"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:"- name: positive_prices\n dataset: products\n type: min\n measure: price\n condition: gt\n threshold: 0\n"})}),"\n",(0,l.jsx)(n.h3,{id:"date-range-validation",children:"Date Range Validation"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:"- name: recent_data\n dataset: transactions\n type: min\n measure: transaction_date\n condition: ge\n threshold: '2024-01-01'\n"})}),"\n",(0,l.jsx)(n.h3,{id:"performance-metrics",children:"Performance Metrics"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:"- name: minimum_response_time\n dataset: api_logs\n type: min\n measure: response_time_ms\n condition: le\n threshold: 5000 # Max acceptable minimum response time\n"})}),"\n",(0,l.jsx)(n.h2,{id:"performance-tips",children:"Performance Tips"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Indexes"}),": Ensure the measure column has appropriate indexes"]}
1),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Partitioning"}),": Use partitioning for time-based queries"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Filters"}),": Apply filters to reduce data scanning"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Statistics"}),": Keep table statistics updated for query optimization"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"related-checks",children:"Related Checks"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"/docs/check-types/max",children:(0,l.jsx)(n.strong,{children:"Max"})})," - Maximum value validation"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"/docs/check-types/sum",children:(0,l.jsx)(n.strong,{children:"Sum"})})," - Sum aggregation validation"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"/docs/check-types/numeric",children:(0,l.jsx)(n.strong,{children:"Numeric"})})," - Custom numeric expressions"]}),"\n"]})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(h,{...e})}):h(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>t,x:()=>d});var s=i(6540);const l={},r=s.createContext(l);function t(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:t(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.