본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트6.2k · #14397

filter-expressions

하는 일

이 스킬은 Lightdash 쿼리 도구를 위한 필터 식을 작성하는 방법을 설명합니다. 행 필터나 조건부 지표 필터가 필요한 쿼리를 만드는 분석가와 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Lightdash 쿼리를 특정 행으로 걸러야 할 때.
  • ✓사용자 정의 지표가 조건에 맞는 행만 세도록 하고 싶을 때.
  • ✓Lightdash에서 필터로 필드 값을 검색할 때.

스킬 링크

https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/filter-expressions/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/filter-expressions/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“북부 지역에서 상태가 completed인 주문만 포함해서 총 매출 Lightdash 쿼리를 실행해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 각 필터 식을 차원, 지표, 테이블 계산 등 맞는 범주에 넣는 방법을 설명합니다. 필터용으로만 쓰는 필드를 그룹화에 추가하지 말라고 경고합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

<!-- Generated by pnpm -F backend generate:filter-expression-skill. -->

Read this before writing filters for expression-enabled tools. It does not apply to tools whose schemas use structured filter objects. Follow each tool's input schema; this skill does not enable unavailable tools or filter modes.

Filter Expressions

For run_metric_query, set queryConfig.filters to null when no query filters are needed. Otherwise, dimensions, metrics, and tableCalculations are independent string expressions or null.

  • A non-null category contains one raw string expression.
  • Choose the category from discovered field metadata (its dimension/metric kind), never from a field name or whether a numeric field sounds metric-like. A raw numeric dimension belongs in dimensions; only metrics and custom metrics belong in metrics.
  • A field used only to restrict rows stays in its filter expression. Do not add it to queryConfig.dimensions unless the user asked to group by or display it: extra selected dimensions change aggregation and table-calculation grain.
  • Table calculations belong only in tableCalculations.
  • Each category is flat and uses AND or OR, never both.
  • The three categories combine implicitly with AND.
  • Aggregation custom metric filters are flat AND expressions.
  • Omit search_field_values.filters for an unscoped search. When present, it is one flat dimension expression string and is AND-only.
  • The tool schema is authoritative for where each string is placed.

Raw placement examples:

  • dimensions: orders_status equals=completed,shipped AND orders_order_date inThePast=2{unit:weeks,completed:true}

  • dimensions (alternatives): orders_promo_code startsWith=VIP OR orders_promo_code endsWith=25

  • metrics: orders_total_order_amount greaterThan=100

  • tableCalculations: rank lessThanOrEqual=10

  • Join flat rules with AND or OR. Do not mix both connectors in one expression.

  • Bare scalars work. Double-quote reserved and whitespace/punctuation strings (apostrophes/parentheses); quote when unsure. Quoted commas/braces literal; backslash escapes. E.g. orders_product_name equals="Coffee Filters (100pk)".

  • Limits: 256 rules; 256 values including settings/rule; 256 characters/literal; 16384 characters/expression.

string

Grammar: <field> <operator form>

  • isNull [0 values]
  • notNull [0 values]
  • equals=<value>[,<value>...] [1+ values]
  • notEquals=<value>[,<value>...] [1+ values]
  • startsWith=<value>[,<value>...] [1+ values]
  • endsWith=<value>[,<value>...] [1+ values]
  • include=<value>[,<value>...] [1+ values]
  • doesNotInclude=<value>[,<value>...] [1+ values]

number

Grammar: <field> <operator form>

  • isNull [0 values]
  • notNull [0 values]
  • equals=<value>[,<value>...] [1+ values]
  • notEquals=<value>[,<value>...] [1+ values]
  • lessThan=<value> [1 value]
  • lessThanOrEqual=<value> [1 value]
  • greaterThan=<value> [1 value]
  • greaterThanOrEqual=<value> [1 value]
  • inBetween=<first value>,<second value> [2 values]
  • notInBetween=<first value>,<second value> [2 values]

date

Grammar: <field> <operator form>

  • isNull [0 values]
  • notNull [0 values]
  • equals=<value>[,<value>...] [1+ values]
  • notEquals=<value>[,<value>...] [1+ values]
  • lessThan=<value> [1 value]
  • lessThanOrEqual=<value> [1 value]
  • greaterThan=<value> [1 value]
  • greaterThanOrEqual=<value> [1 value]
  • inThePast=<count>{unit:<unit>,completed:<bool>} [1 count; settings required]
  • notInThePast=<count>{unit:<unit>,completed:<bool>} [1 count; settings required]
  • inTheNext=<count>{unit:<unit>,completed:<bool>} [1 count; settings required]
  • inTheCurrent=<unit>[{toDate:true[,excludeToday:true]}] [1 unit; settings optional]
  • notInTheCurrent=<unit>[{toDate:true[,excludeToday:true]}] [1 unit; settings optional]
  • inBetween=<first value>,<second value> [2 values]
  • Units: days, weeks, months, quarters, years; completed=false includes partial, true completed only.
  • Current-period bounds: {toDate:true} ends the current week/month/quarter/year at today ("month to date"); {toDate:true,excludeToday:true} ends it at yesterday (today's partial data excluded). Not valid for days.

boolean

Grammar: <field> <operator form>

  • isNull [0 values]
  • notNull [0 values]
  • equals=<value> [1 value]
  • notEquals=<value> [1 value]
자주 묻는 질문

필터는 어디에 넣나요?

필드에 맞는 범주에 넣으며, 예를 들어 차원이나 지표 범주가 있습니다.

필터가 그룹화를 바꾸나요?

필드를 그룹화에 추가할 때만 바뀌므로, 필터 전용 필드는 그룹화에 넣지 말라고 스킬에 나와 있습니다.

모든 필터 모드를 쓸 수 있나요?

스킬은 각 도구의 입력 스키마를 따르므로, 그 도구가 지원하는 모드만 적용됩니다.

상세 정보

작성자의 원본 설명

Author filter expressions for run_metric_query and search_field_values, including conditional custom metric filters.

repo: lightdash/lightdash

인기도

GitHub 스타
6.2k
순위
#14397
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬