Repository: lightdash/lightdash (2025-07-14T07:07:12Z)

Issue:
I want options for `greater than or equal to` and `less than or equal to` when filtering number dimensions
### Description

Right now Lightdash only offers `greater than` and `less than` but it would be useful to also have an option for `or equal to`. 

### What problem does this solve?

More specificity in filter options


Discussion:
This issue was mentioned by a user in slack: https://lightdash.slack.com/archives/C06J189BQCR/p1737378887001329?thread_ts=1737378887.001329&cid=C06J189BQCR
This issue was mentioned by a user in slack: https://lightdash.slack.com/archives/C071TU6FZ3P/p1752140799205029?thread_ts=1752140799.205029&cid=C071TU6FZ3P
:tada: This issue has been resolved in version 0.1808.0 :tada:

The release is available on:
- `0.1808.0`
- [GitHub release](https://github.com/lightdash/lightdash/releases/tag/0.1808.0)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:



Patch:
diff --git a/packages/common/src/ee/AiAgent/schemas/filters/numberFilters.ts b/packages/common/src/ee/AiAgent/schemas/filters/numberFilters.ts
index 9a7dd3ac770f3..bc8f7cc101e3d 100644
--- a/packages/common/src/ee/AiAgent/schemas/filters/numberFilters.ts
+++ b/packages/common/src/ee/AiAgent/schemas/filters/numberFilters.ts
@@ -18,7 +18,9 @@ const numberFilterSchema = z.union([
     z.object({
         operator: z.union([
             z.literal(FilterOperator.LESS_THAN),
+            z.literal(FilterOperator.LESS_THAN_OR_EQUAL),
             z.literal(FilterOperator.GREATER_THAN),
+            z.literal(FilterOperator.GREATER_THAN_OR_EQUAL),
         ]),
         values: z.array(z.number()).length(1),
     }),
diff --git a/packages/frontend/src/components/common/Filters/FilterInputs/utils.ts b/packages/frontend/src/components/common/Filters/FilterInputs/utils.ts
index a2a6cd1b2281b..810de24b22690 100644
--- a/packages/frontend/src/components/common/Filters/FilterInputs/utils.ts
+++ b/packages/frontend/src/components/common/Filters/FilterInputs/utils.ts
@@ -81,7 +81,9 @@ export const getFilterOperatorOptions = (
                 FilterOperator.EQUALS,
                 FilterOperator.NOT_EQUALS,
                 FilterOperator.LESS_THAN,
+                FilterOperator.LESS_THAN_OR_EQUAL,
                 FilterOperator.GREATER_THAN,
+                FilterOperator.GREATER_THAN_OR_EQUAL,
                 FilterOperator.IN_BETWEEN,
                 FilterOperator.NOT_IN_BETWEEN,
             ]);
diff --git a/packages/frontend/src/components/common/Filters/FilterRuleForm.tsx b/packages/frontend/src/components/common/Filters/FilterRuleForm.tsx
index 0f5e2ab1c4afc..6c7aab3797678 100644
--- a/packages/frontend/src/components/common/Filters/FilterRuleForm.tsx
+++ b/packages/frontend/src/components/common/Filters/FilterRuleForm.tsx
@@ -110,7 +110,7 @@ const FilterRuleForm: FC<Props> = ({
             />
             <Select
                 size="xs"
-                w="150px"
+                w="175px"
                 sx={{ flexShrink: 0 }}
                 withinPortal={popoverProps?.withinPortal}
                 onDropdownOpen={popoverProps?.onOpen}
diff --git a/packages/frontend/src/components/common/Filters/utils/getPlaceholderByFilterTypeAndOperator.ts b/packages/frontend/src/components/common/Filters/utils/getPlaceholderByFilterTypeAndOperator.ts
index 598fed4d34718..51b6548562910 100644
--- a/packages/frontend/src/components/common/Filters/utils/getPlaceholderByFilterTypeAndOperator.ts
+++ b/packages/frontend/src/components/common/Filters/utils/getPlaceholderByFilterTypeAndOperator.ts
@@ -26,6 +26,8 @@ export const getPlaceholderByFilterTypeAndOperator = ({
                     return singleValue ? 'Enter value' : 'Enter value(s)';
                 case FilterOperator.LESS_THAN:
                 case FilterOperator.GREATER_THAN:
+                case FilterOperator.LESS_THAN_OR_EQUAL:
+                case FilterOperator.GREATER_THAN_OR_EQUAL:
                     return 'Enter value(s)';
                 case FilterOperator.NULL:
                 case FilterOperator.NOT_NULL:


Test patch:
diff --git a/packages/common/src/types/filterGrammar.test.ts b/packages/common/src/types/filterGrammar.test.ts
index 3ae6996e8c6c8..8aeb95a5df175 100644
--- a/packages/common/src/types/filterGrammar.test.ts
+++ b/packages/common/src/types/filterGrammar.test.ts
@@ -239,7 +239,7 @@ describe('Parse metric filters', () => {
 
         expect(
             removeIds(
-                parseFilters([{ order_id: '> 5' }, { order_id: '< 10' }]),
+                parseFilters([{ order_id: '> 5' }, { order_id: '<= 10' }]),
             ),
         ).toStrictEqual([
             {
@@ -252,7 +252,7 @@ describe('Parse metric filters', () => {
             },
             {
                 id: undefined,
-                operator: FilterOperator.LESS_THAN,
+                operator: FilterOperator.LESS_THAN_OR_EQUAL,
                 target: {
                     fieldRef: 'order_id',
                 },