# 一致ループのマッピング

入力ループを一致する出力ループにマッピングします。

## 始める前に

入力ストラクチャーと出力ストラクチャーを持つマップを作成済みであること。この例では、[Other Projects] (他のプロジェクト) &gt; [Examples] (例) &gt; [Structures] (ストラクチャー) &gt; [Simple] (シンプル) &gt; [MaAndPaSupplier] &gt; [MandPPOFile]を入力として、 [Other Projects] (他のプロジェクト) &gt; [Examples] (例) &gt; [Structures] (ストラクチャー) &gt; [Simple] (シンプル) &gt; [POStandard] &gt; [SimpleShipNoticeFile]を出力として使用できます。

## このタスクについて

この例では、入力PurchaseOrderループを出力Noticeループにマッピングする必要があります。

このマップは、[Other Projects] (他のプロジェクト) &gt; [Examples] (例) &gt; [Maps] (マップ) &gt; [Looping] (ルーピング) &gt; [LoopSimple]にあります。

## 手順

1. 入力PurchaseOrderを出力Noticeにドラッグします。

   Numエレメントが自動的にマッピングされ、SimpleLoopファンクションがNoticeループに追加されて、入力PurchaseOrderループへの参照が引数として使用されます。 ![](https://help.qlik.com/talend/ja-JP/data-mapper-user-guide/Resources/images/matching_loops_01_notice.png)
2. 入力LineItemsを出力Itemsにドラッグします。

   エレメントが自動的にマッピングされ、SimpleLoopファンクションがItemsに追加されます。
3. オプション: 必要であれば他のエレメントもマッピングします。

## タスクの結果

ループがマッピングされます。サンプル入力ファイルに基づいて出力を確認する場合は、[Test Run] (テスト実行)ボタンを使います。この例での出力は次のようになります。

```
<Notices>
  <Notice>
    <Num>1</Num>
    <Items>
      <PartNum>1</PartNum>
      <Quantity>1</Quantity>
    </Items>
    <Items>
      <PartNum>2</PartNum>
      <Quantity>13</Quantity>
    </Items>
  </Notice>
  <Notice>
    <Num>1</Num>
    <Items>
      <PartNum>89</PartNum>
      <Quantity>500</Quantity>
    </Items>
    <Items>
      <PartNum>10S334</PartNum>
      <Quantity>1000</Quantity>
    </Items>
  </Notice>
  <Notice>
    <Num>2</Num>
    <Items>
      <PartNum>1A6</PartNum>
      <Quantity>100</Quantity>
    </Items>
    <Items>
      <PartNum>558</PartNum>
      <Quantity>130</Quantity>
    </Items>
  </Notice>
</Notices>
```