When creating a Chrono report, you may need to report results for multiple values for a single field. To make writing Chrono reports simpler and easier to read, you may wish to create an Iterator row to easily return multiple field values with very few lines of filtering and configuring in the Chrono Setup. This works especially well with larger lists of Values.
________________________________________________________________________________________________________________________
Using Iterators and Data Source Fields
The simplest way to use an Iterator is to iterate on a field within a Data Source, such as the Database. You may find the need to return "mined tonnes" by pit in your project, and if that project contains multiple Pit locations, you may wish to use an Iterator to do so. Follow the steps below to iterate upon a field in the Database, in this case "OriginalSource.Pit".
-
Create a Title Row called "Pit Tonnes"
- Create an Iter row, and indent this row by 1. Select the "Database" as the Data Source, and under the Item column, select "OriginalSource.Pit". By doing so, we have given the report instructions to return all values in the "OriginalSource.Pit" field.
An Iter row does not need a Caption or Name to be populated, as each value in the Iterating field will exist as the Row Name, in addition to any row the Iter is already Indented under.
-
Finally, we need to then tell the Iterator what reporting value we want to return for each value in the OriginalSource.Pit field. In this example, we will return the Mining_wetTonnes for each Pit.
-
Create a new Row, giving this row a Caption, like "Mining_wetTonnes". We must then indent this row to 2 under the Iterator so that it becomes a "child" row. We then select the Database as the Data Source and Mining_wetTonnes as the Item.
- The result is then, Mining_wetTonnes returned for each pit in the Database, mined by period. The benefit of using the Database to Iterate is that if a new pit is added or a pit is removed from the Database, the Iterator will adjust accordingly without any additional configuration.
________________________________________________________________________________________________________________________
Using Iterators and Custom Lists
Instead of referring to a traditional Data Source, Iterators can be used to return values from a user-defined and managed Custom List.
-
Click the button labelled "Manage Custom Lists"
-
Add a new custom list and label it "grades". Add three items to the list: "Mining_grades_Al", "Mining_grades_Fe", "Mining_grades_Si". It is important to note that the values entered in this list must be exact to the field names you wish to return values for.
In this window, you can also remove and reorder Custom Lists and the values that exist within them. You may also wish to export your custom lists to be used in other projects.
- Create a new Title row, titled Stockpile Closing Stats.
4. Create a new Iterator row and indent it 1 under the title row. Select CustomLists in the Data Source column, then select the name of the custom list ("grades") in the drop-down box under the Item column.
5. Finally, create a new Row and indent it under the Iterator row. Select "ClosingInventory" in the Data Source column, then manually type <grades> in the Item Column. When the Item is flanked by <>, we are telling the report to return results for all the Items in the Custom List. And in this case, the custom list is <grades>.
When viewing the results, it should return the closing grades for all of our stockpiles using the Mining_grades_* items in our custom list.
________________________________________________________________________________________________________________________
Using Iterators in both Custom Lists and Data Source Fields
Iterators can be used to iterate on an Iterator!
The example below describes the process of an Iterator row returning all values in the "Truck" field of the Database by creating the row below. An additional Iterator row then iterates for each Truck value in the Database, each of the following values in the Custom List titled "truckstats";
An additional Iterator row then Iterates for each Truck value in the Database, each of the following values in the Custom List titled "truckstats";
We can achieve this by including an additional Iterator indented under the previous as below;
Finally we return the required values by including the final data row, as per below. Without this final row, no data is returned.
It is important that each additional Iterator and data row is indented correctly for the Chrono Iterator to report the correct data. If not, you will receive an error message similar to below, which describes;
"An Iter row must have children", in other words, each "Iter" row must have an appropriate indented row beneath it. Without this, the Iterator is not valid, and the table cannot be viewed.
The resultant table report now shows us truck stats for each of the Trucks in our project.
________________________________________________________________________________________________________________________
Want to learn more?
Online Help Manuals - Click here for the latest version
Learning Management System - Click here to login or here to request access
Comments
0 comments
Please sign in to leave a comment.