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:

Rest_ex2a_8003d8ef_8003d8ef.png
  1. 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:

    Rest_ex2b_8003d8f0_8004b39c.png
  2. 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

    Rest_ex2c_8003d8f1_8004b39e.png
  3. 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:

    Rest_ex2d_8003d8f2_8004b3a0.png
  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