# MapSubstring 스크립트 함수

MapSubstring 스크립트 함수는 이전에 로드된 매핑 테이블에 표현식의 일부를 매핑하는 데 사용됩니다. 매핑은 대/소문자가 구분되고 반복적이지 않으며, 부분 문자열은 왼쪽에서 오른쪽으로 매핑됩니다.

구문:

MapSubstring('map\_name', expression)

반환 데이터 유형: 문자열

인수:

인수

| 인수 | 설명 |
| --- | --- |
| map\_name | 이전에 mapping load 또는 mapping select 문으로 읽은 매핑 테이블의 이름입니다. 이 이름은 곧은 작은따옴표로 묶어야 합니다.<br><br>경고 메모매크로 확장 변수에서 이 함수를 사용하고 존재하지 않는 매핑 테이블을 참조하면 함수 호출에 실패하고 필드가 만들어지지 않습니다. |
| expression | 부분 문자열이 결과를 매핑할 표현식입니다. |

이 예에서는 제품 모델 목록을 로드합니다. 각 모델에는 복합 코드로 지정된 일련의 특성이 있습니다. 매핑 테이블을 MapSubstring과 함께 사용하면 특성 코드를 설명으로 확장할 수 있습니다.

```
map2:
mapping LOAD * 
Inline [
AttCode, Attribute
R, Red
Y, Yellow
B, Blue
C, Cotton
P, Polyester
S, Small
M, Medium
L, Large
] ;

Productmodels:
LOAD *,
MapSubString('map2', AttCode) as Description
Inline [
Model, AttCode
Twixie, R C S
Boomer, B P L
Raven, Y P M
Seedling, R C L
SeedlingPlus, R C L with hood
Younger, B C with patch
MultiStripe, R Y B C S/M/L 
] ;
// We don't need the AttCode anymore
Drop Field 'AttCode';
```

결과 테이블은 다음과 같습니다.

Resulting table

| Model | Description |
| --- | --- |
| Twixie | Red Cotton Small |
| Boomer | Blue Polyester Large |
| Raven | Yellow Polyester Medium |
| Seedling | Red Cotton Large |
| SeedlingPlus | Red Cotton Large with hood |
| Younger | Blue Cotton with patch |
| MultiStripe | Red Yellow Blue Cotton Small/Medium/Large |

## 자세한 정보

* [](https://help.qlik.com/ko-KR/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/Mapping.htm)[매핑](https://help.qlik.com/ko-KR/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/Mapping.htm)
* [스크립트에서 인용 부호 사용](https://help.qlik.com/ko-KR/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/use-quotes-in-script.htm)