Example 2
Our second example is more complicated. In this example, we use the same input structure to group the time transactions per day (date) and employee.
See Grouping topic in Restructure concepts.
This diagram shows the output structure:
- Create loops.
In this example, the loops are used to control the three repetitive elements in the output document.
This diagram shows that the nested loops are controlled by Restructure functions:
- Select data.
Drag and drop all data elements to use:
-
From the input document to the Restructure functions
-
From the Restructure functions to the elements and attribute in the output document
-
- Select input loop levels.
This table shows the movements of the elements:
Element Movement Time To get all the dates, drag and drop the Time element to loop on this element from the input document to the first (outmost) Restructure function’s header.
Employee To get all the dates, drag and drop the Employee element to loop on this element from the input document to the second (middle) Restructure function’s header.
Time To get all the dates, drag and drop the Time element to loop on this element from the input document to the last (inner) Restructure function’s header.
This diagram shows the completed input loop levels:
- Sort and group the data.
Set the properties for the input parameters to get the correct sorting and grouping.
-
In the first restructure function, to make the outmost restructure loop, create one WorkingDay output element per unique date for all time transactions.
Follow these property settings:
Property Setting Sorting Sequence 1 for Date Is Grouped true for Date -
In the second Restructure function:
To create one Employee element per unique combination of first name and last name, follow these property settings:
Property Setting Sorting Sequence 1 for FirstName
2 for LastName
Is Grouped true for LastName -
In the last Restructure function:
To sort the time transactions on project per employee and date, follow these property settings:
Property Setting Sorting Sequence 1 for Project To avoid duplicate transactions for a project per employee and date, apply these property settings in the last (inner) Restructure function:
Property Setting Is Grouped true for Project Is Summable true
-