Example 2

Our second example is more complicated. In this example, we will use the same input structure to group the time transactions per day (date) and employee.

For more information on grouping see, Grouping topic in Restructure concepts.

This diagram shows the output structure:

  1. Create loops.

    In this example, the loops will control the three repetitive elements in the output document.

    This diagram shows that the nested loops are controlled by Restructure functions.

  2. Select data.

    Drag and drop all data elements we want to use.

    Follow these guidelines:

    • From the input document to the Restructure functions, and

    • From the Restructure functions to the elements and attribute in the output document.

  3. Select input loop levels.

    This table shows the movements of the elements:

    Element Movement
    Time

    Objective: 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

    Objective: To get all the employees

    Drag and drop the Employee element to loop on this element

    • from the input document

    • to the second (middle) Restructure function’s header

    Time

    Objective: To get all the time transactions per employee and date

    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 show the completed input loop levels.

  4. 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