Skip to main content

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.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!