Technical

Tips

How to Add Up Multiple Rows of Data

You can download a sample script for this tip by clicking on the following link.
Please download the sample script and try it out.

How to use the sample script:
1. Download the sample script file to local disk from above link.
2. Start DataMagic Manager and log in.
3. From the menu of DataMagic Management screen, select Import Management Information and import the sample script.
4. Download the sample data files and place them to the indicated path as below.

Introduction

Let's talk about how to aggregate the values for multiple rows of data.
By applying this function, you can calculate important figures such as the total sales for each individual store or the total sales by region.

Processing diagram

Functions used
   - Variables
   - Numeric value conversion
   - Post-processing

Diagram of completed data processing information and required settings

Sample data files

  • *Click to download the sample data files and place them to the indicated place.
How to Create Sample Data Processing Information
1. Create new data processing information with the name Tips5.
2. Double-click Input Settings to open the Input Settings window, and set the input file.
3. For Add extraction condition, select OK.
4. Double-click Output Settings to open the Output Settings window, and set the output file.
5. Open Variable Settings.
6. Define a variable with which to store the total value.
7. Add the variable you defined to the extraction conditions, and open the Variable Assignment Settings for that variable.
8. Specify the output information for the variable you defined.
9. Select Numeric operations.
10. As the value for the variable, define the formula to be used to add the values from the input data.
11. In Variable Assignment Settings, click OK to close the window.
12. Associate the extraction conditions with the output settings, and double-click Set Mapping Information to open the Set Mapping Information window.
13. Map the Input Data and Output Data fields.
14. Define a post-processing to output the calculated value to the final row.
15. Map the calculated value of the variable to the output field.
16. Apply the data processing information, and execute processing. If the output is the same as in the processing diagram, the processing was successful.

Tip: If you do not want to output any digits after the decimal point, perform the following procedure in Set Mapping Information.

In Conclusion

So, what do you think?
In Tip No. 3, we calculated only a single record. But by combining this calculation with a variable, you can calculate values from multiple records.
Note that you can use not only numeric values but also other values such as character strings for variables to be combined.