# Creating a Job script to aggregate and sort scores

This example shows how to write a Job script to define a Job that will aggregate the a student's scores of different months and then sort the scores based on the total score of each subject.

The Job will contain the following components:

* three tFileInputDelimited components, to read the source files that contain the scores of three months: scores\_month1.csv, scores\_month2.csv, and scores\_month3.csv. Each of the source files contains two columns, as shown below.

  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
  ```

* a tUnite component, to merge the three input flows into one.

* a tAggregateRow component, to aggregate the scores to get the total score, the average score, and highest scores, and the lowest scores of each subject in three months.

* a tSortRow component, to sort the scores based on the total score of each subject.

* a tLogRow component, to display the aggregation and sorting results.

### In this section

* [Defining the input components to read the scores](https://help.qlik.com/talend/en-US/job-script-reference-guide/8.0/defining-input-components-to-read-scores)
* [Merging the input flows](https://help.qlik.com/talend/en-US/job-script-reference-guide/8.0/merging-input-flows)
* [Aggregating the scores](https://help.qlik.com/talend/en-US/job-script-reference-guide/8.0/aggregating-scores)
* [Sorting the aggregated scores](https://help.qlik.com/talend/en-US/job-script-reference-guide/8.0/sorting-aggregated-scores)
* [Displaying the aggregation and sorting result](https://help.qlik.com/talend/en-US/job-script-reference-guide/8.0/displaying-aggregation-and-sorting-result)
* [Connecting the components](https://help.qlik.com/talend/en-US/job-script-reference-guide/8.0/connecting-components)
* [Generating and executing the Job to aggregate and sort scores](https://help.qlik.com/talend/en-US/job-script-reference-guide/8.0/generating-and-executing-job-to-aggregate-and-sort-scores)