> For the complete documentation index, see [llms.txt](https://docs.flextudio.com/flextudio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flextudio.com/flextudio/concept/filter-sector-status-condition.md).

# \[심화] Filter - 섹터(Sector) Status, Condition

모든 컬렉션에서 원하는 섹터를 필터링해서 연결하거나 수집할 수 있습니다. 필터를 사용하는 방법이 알고 싶다면 이 페이지가 도움이 됩니다.

{% hint style="info" %}
[데이터의 상태관리(Sector Status)](https://docs.flextudio.com/flextudio/concept/sector-status.md) 에서 상태에 대한 이해를 도울 수 있습니다.
{% endhint %}

## 필터종류

<table data-header-hidden><thead><tr><th width="188"></th><th></th></tr></thead><tbody><tr><td><a href="#undefined-1"><strong>상태 필터</strong></a></td><td>데이터(Sector)의 상태값에 따라 필터링 할 수 있습니다.</td></tr><tr><td><a href="#undefined-2"><strong>조건 필터</strong></a></td><td>조건을 설정하여 조건에 부합하는 데이터(Sector)를 필터링 할 수 있습니다.</td></tr><tr><td><a href="#undefined-5"><strong>커스텀 필터</strong></a></td><td>직접 여러 조건을 설정하여 조건에 부합하는 데이터(Sector)를 필터링 할 수 있습니다.</td></tr><tr><td><a href="#parent-sector-filter">Parent Sector filter</a>(개정 전)</td><td>데이터연결을 할때 부모 그룹을 그려주는 섹터의 특정 키값이 같은 데이터(Sector)들만 필터링 할 수 있습니다.</td></tr></tbody></table>

## 상태 필터

<figure><img src="https://2124792335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSGiM6UdbWlqrZA6kPT9b%2Fuploads%2F2SCqtEySIruWe8Fw4R3x%2Fimage.png?alt=media&amp;token=29ea2104-e769-434a-a97f-5fc8001fe155" alt=""><figcaption></figcaption></figure>

* Active: 현재 활성화된 데이터만을 선택합니다.
* Selected: 사용자가 직접 선택한 데이터만을 선택합니다.
* Last Reflected: 가장 최근에 반영된 변경사항이 있는 데이터만을 선택합니다.
* Added: 최근에 추가된 데이터만을 선택합니다.
* Updated: 최근에 업데이트된 데이터만을 선택합니다.
* Deleted: 삭제된 데이터만을 선택합니다.

## 조건 필터

<figure><img src="https://2124792335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSGiM6UdbWlqrZA6kPT9b%2Fuploads%2F5A5Ejgt4BUXt29BgVffL%2Fimage.png?alt=media&amp;token=7ad34645-2feb-4987-a603-26ef01f6c6cc" alt=""><figcaption></figcaption></figure>

* Not\_Exists : 특정 값이 존재하지 않는 데이터만을 선택합니다.
* Exists : 특정 값이 존재하는 데이터만을 선택합니다.
* \== : 특정 값과 정확히 일치하는 데이터만을 선택합니다.
* != : 특정 값과 일치하지 않는 데이터만을 선택합니다.
* < : 특정 값보다 작은 데이터만을 선택합니다.
* <= : 특정 값 이하의 데이터만을 선택합니다.
* \> : 특정 값보다 큰 데이터만을 선택합니다.
* \>= : 특정 값 이상의 데이터만을 선택합니다.
* Like : 특정 패턴이나 문자열을 포함하는 데이터만을 선택합니다. SQL의 like와 동일한 기능으로 가능한 패턴으로는 <mark style="color:purple;">`%`</mark> 와 <mark style="color:purple;">`_`</mark> 가 있고 <mark style="color:purple;">`%`</mark>는 모든문자, <mark style="color:purple;">`_`</mark>는 한글자를 의미합니다.   &#x20;
* RegExp : 정규 표현식 패턴에 맞는 데이터만을 선택합니다.\
  ![](https://2124792335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSGiM6UdbWlqrZA6kPT9b%2Fuploads%2FgjNmtcqmi9PRsTizkZC7%2Fimage.png?alt=media\&token=c273f23f-b2c5-40d6-8624-d9919e650e4e)

  참고 - [Regular expression syntax cheat sheet - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Cheatsheet)

#### 대상 컬렉션 키&#x20;

비교하려고 하는 키 명칭

#### 연산자

비교하려는 값 또는 정규식

비교하려는 값은 [대체텍스트](https://docs.flextudio.com/flextudio/concept/alternative.md)를 통해 다양한 값을 동적으로 비교값으로 만들어줄 수 있습니다.

## 커스텀 필터

<figure><img src="https://2124792335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSGiM6UdbWlqrZA6kPT9b%2Fuploads%2FCU5PWQv02B5C0w6qHiSv%2Fimage.png?alt=media&amp;token=3be17545-3835-4064-95f6-522ee2c162e9" alt=""><figcaption></figcaption></figure>

대상 섹터는 <mark style="color:purple;">`sector`</mark>변수로 지정됩니다.

```javascript
//if 문을생략하고 조건을 넣음.
sector.orderCount > 0 || sector.orderCount == _c.activeSector.orderCount
```

```javascript
// 직접 조건에 따른 return 을 해주는 경우
for(...) {
	if(...) {
		return true;
	}
}
return false;
```

## Parent Sector filter

{% hint style="info" %}
[\[심화\] 카테고리 연결관계](https://docs.flextudio.com/flextudio/concept/undefined.md)에서 연결관계에 대한 이해를 도울 수 있습니다.
{% endhint %}

해당 필터를 사용하기 위해서는 필요한 조건이 있습니다. 상위 그룹에 데이터 연결이 되어있고 하위 컴포넌트(그룹 또는 레이아웃)에 데이터 연결이 되어있을 경우 입니다. 하위 컴포넌트에서 데이터 용도를 조회로 사용할 때 Parent Sector filter를 사용할 수 있습니다.

<figure><img src="https://2124792335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSGiM6UdbWlqrZA6kPT9b%2Fuploads%2FGHJwnRtUIwdZC6YKG0Hm%2Fimage.png?alt=media&amp;token=6abbf713-5ca4-4540-a818-6a8fcee50037" alt="" width="317"><figcaption></figcaption></figure>

* 상위 컬렉션 키 \
  부모(상위) 그룹을 그려주는 섹터에서 비교하려고 하는 키 명칭
* 현재 컬렉션키\
  현재(하위) 그룹/레이아웃을 그려주는 섹터에서 비교하려고 하는 키 명칭


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flextudio.com/flextudio/concept/filter-sector-status-condition.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
