# スコアの集計とソートを行うジョブスクリプトの作成

この例では、複数月の学生のスコアを集計し、各教科の合計点で得点をソートするジョブを定義するジョブスクリプトが作成されています。以下、その作成方法を説明します。

このジョブには、以下のコンポーネントが含まれます。

* 3つのtFileInputDelimitedコンポーネントを指定して、scores\_month1.csv、scores\_month2.csv、とscores\_month3.csvの3か月のスコアを含むソースファイルを読み取ります。各ソースファイルは、以下のとおり、2つのカラムで構成されています。

  scores\_month1.csv:

  ```
  subject;score
  Math;99
  English;89
  Computer;92
  Arts;93
  History;91
  ```

  scores\_month2.csv:

  ```
  subject;score
  Math;98
  English;97
  Computer;94
  Arts;96
  History;95
  ```

  scores\_month3.csv:

  ```
  subject;score
  Math;95
  English;96
  Computer;96
  Arts;92
  History;98
  ```

* tUniteコンポーネント。3つの入力フローを1つにマージします。

* tAggregateRowコンポーネント。スコアを集計し、合計点、さらに、各教科の3か月間における平均点、最高点、最低点を算出します。

* tSortRowコンポーネント。各教科の合計点に基づいて得点をソートします。

* tLogRowコンポーネント。集計結果とソート結果を表示します。

### このセクション内

* [スコアを読み込む入力コンポーネントを定義する](https://help.qlik.com/talend/ja-JP/job-script-reference-guide/8.0/defining-input-components-to-read-scores)
* [入力フローのマージ](https://help.qlik.com/talend/ja-JP/job-script-reference-guide/8.0/merging-input-flows)
* [スコアの集計](https://help.qlik.com/talend/ja-JP/job-script-reference-guide/8.0/aggregating-scores)
* [集計スコアのソート](https://help.qlik.com/talend/ja-JP/job-script-reference-guide/8.0/sorting-aggregated-scores)
* [集計結果とソート結果を表示する](https://help.qlik.com/talend/ja-JP/job-script-reference-guide/8.0/displaying-aggregation-and-sorting-result)
* [コンポーネント間の接続](https://help.qlik.com/talend/ja-JP/job-script-reference-guide/8.0/connecting-components)
* [スコアを集計してソートするジョブを生成および実行する](https://help.qlik.com/talend/ja-JP/job-script-reference-guide/8.0/generating-and-executing-job-to-aggregate-and-sort-scores)