How do I create a dictionary from two variables?

I have an array from which I am obtaining the date field:

local!weeks: index(
    ri!casualWorkSchedule,
    "weeks",
    {}
  ),

I then have a second variable for hours on which I do a calculation on the passed array:

local!proposedHours: tointeger(
    a!forEach(
      items: ri!casualWorkSchedule,
      expression: rule!CAT_calculateProposedHoursFromCasualWorkSchedule(tempWorkSchedule: fv!item)
    )
  ),

From these two variables I wish to create a dictionary such as:

Any suggestions on how this may be achieved would be appreciated.

Thanks

Irene Best

  Discussion posts and replies are publicly visible

Parents
  • Further to my question above, you may wish to know what I am attempting to do.

    Basically, I need to calculate if the total hours for a week are greater than 36.75.

    Already allocated hours are sourced from a view.  Hours being assigned are sourced from a process variable as they are not stored until the process is completed.  A warning needs to be displayed prior to the process completing for allocated hours + proposed hours > 36.75.

    The total hours is already calculated in the view.  The proposed hours need to be calculated by summing each (pay code hours X sessions) where the paycode and sessions are input by the user and stored in a process variable.

    This is per week where there may be many weeks.

    Just for some clarity on what I am trying to achieve Slight smile

Reply
  • Further to my question above, you may wish to know what I am attempting to do.

    Basically, I need to calculate if the total hours for a week are greater than 36.75.

    Already allocated hours are sourced from a view.  Hours being assigned are sourced from a process variable as they are not stored until the process is completed.  A warning needs to be displayed prior to the process completing for allocated hours + proposed hours > 36.75.

    The total hours is already calculated in the view.  The proposed hours need to be calculated by summing each (pay code hours X sessions) where the paycode and sessions are input by the user and stored in a process variable.

    This is per week where there may be many weeks.

    Just for some clarity on what I am trying to achieve Slight smile

Children