Overview of this example
The figure below describes the file that is input and the file that is output after the conversion in this example.

Figure 8.100 Conversion example (aggregate function-like processing)
The records are processed in the order set in the mapping. Note that the post-process (relation line 3)) will be performed at the end.
The table below describes the order in which the conversion processing is performed in the example.
Details of the processing are given below. Note that the numbers in the explanations correspond to those in the Processing order column in Table 8.3 .
Processing target: Record 1
name |
english |
science |
math |
---|---|---|---|
Aoki |
60 |
95 |
55 |
1. Based on the numeric operation formula, the following values are set for the variables.
total_score_english |
: |
0+60=60 |
("total_score_english(=initial value)" + "mark of English in Record 1") |
total_score_science |
: |
0+95=95 |
("total_score_science(=initial value)" + "mark of Science in Record 1") |
total_score_math |
: |
0+55=55 |
("total_score_math(=initial value)" + "mark of Math in Record 1") |
2. The following values are output to the output file:
name |
: |
Aoki |
(name in Record 1) |
english |
: |
60 |
(mark of English in Record 1) |
science |
: |
95 |
(mark of Science in Record 1) |
math |
: |
55 |
(mark of Math in Record 1) |
The following is the content of the output file:
name |
english |
science |
math |
---|---|---|---|
Aoki |
60 |
95 |
55 |
Processing target: Record 2
name |
english |
science |
math |
---|---|---|---|
Sato |
82 |
40 |
60 |
3. Based on the numeric operation formula, the following values are set for the variables.
total_score_english |
: |
60+82=142 |
("total_score_english" + "mark of English in Record 2") |
total_score_science |
: |
95+40=135 |
("total_score_science" + "mark of Science in Record 2") |
total_score_math |
: |
55+60=115 |
("total_score_math" + "mark of Math in Record 2") |
4. The following values are output to the output file:
name |
: |
Sato |
(name in Record 2) |
english |
: |
82 |
(mark of English in Record 2) |
science |
: |
40 |
(mark of Science in Record 2) |
math |
: |
60 |
(mark of Math in Record 2) |
The following is the content of the output file:
name |
english |
science |
math |
---|---|---|---|
Aoki |
60 |
95 |
55 |
Sato |
82 |
40 |
60 |
Processing target: Record 3
name |
english |
science |
math |
---|---|---|---|
Morita |
85 |
75 |
87 |
5. Based on the numeric operation formula, the following values are set for the variables.
total_score_english |
: |
142+85=227 |
("total_score_english" + "mark of English in Record 3") |
total_score_science |
: |
135+75=210 |
("total_score_science" + "mark of Science in Record 3") |
total_score_math |
: |
115+87=202 |
("total_score_math" + "mark of Math in Record 3") |
6. The following values are output to the output file:
name |
: |
Morita |
(name in Record 3) |
english |
: |
85 |
(mark of English in Record 3) |
science |
: |
75 |
(mark of Science in Record 3) |
math |
: |
87 |
(mark of Math in Record 3) |
The following is the content of the output file:
name |
english |
science |
math |
---|---|---|---|
Aoki |
60 |
95 |
55 |
Sato |
82 |
40 |
60 |
Morita |
85 |
75 |
87 |
Post-process
7. The following values are output to the output file:
name |
: |
Average |
(fixed character string) |
english |
: |
227 / 3=75.7 |
("total_score_english" / 3) |
science |
: |
210 / 3=70 |
("total_score_science " / 3) |
math |
: |
202 / 3=67.3 |
("total_score_math" / 3) |
The following is the content of the output file:
name |
english |
science |
math |
---|---|---|---|
Aoki |
60 |
95 |
55 |
Sato |
82 |
40 |
60 |
Morita |
85 |
75 |
87 |
Average |
75.7 |
70.0 |
67.3 |