2 Replies Latest reply on Feb 2, 2012 7:17 PM by tomswell

    sum(filtered portal) difficulty

    tomswell

      Title

      sum(filtered portal) difficulty

      Post

       

       

      GOAL: more than one person may share same time on same ToDo event

      ... one "laborers" field with multiple entries helps conserve screenscape … 

      I want to select , view and resolve total hours for selected person … for further processing.

       

      It's the Sum(filtered values being displayed) that’s go me stumped?

       

      yes > I have placed SUM(c_TimeTotal) within single line portal with same filter without success.

       

       

      2- tables        PAYCHECK [X] TODO 

                                             (cartesian)

      table PAYCHECK  field :

      Payee_Key > text- global,by valuelist (employee ids)

       

      table TODO fields;

      laborers          text-indexed {multiple values can be selected into this field via drop down list> valuelist(employee ids)}

      timeStart        time

      timeEnd         time

      c_TimeTotal(Case (IsEmpty(TimeEnd) or IsEmpty(TimeStart);"";TimeEnd-TimeStart)

      c_isTime(Case ( TimeTotal=""; 0;1))

      c_isPayee_Key(PatternCount (laborers; paychecks_::PayeeKey  ) ≠ ""

                

       

      PROBLEM: I'm viewing TODO portal

       individual laborer is selected for viewing by selecting Payee_Key via valuelist = valid employee id

       and

      TODO filter:      ( todo_filtered::c_isPayee_key=1 and todo_filtered::c_isTime=1)

                                     a valid payee id              and        total time ≠ ""        
       

       

       

      "labor Portal" Shows  TODO records with selected payee_key as anticipated but I can't seem to be able to display total for shown records.

      I've tried to SUM(c_TimeTotal)  presuming displayed values would be tallied (as with typical listed "find result")

      also  I have placed SUM(c_TimeTotal) within single line portal with same filterand with no portal .

      odd numbers result?

        • 1. Re: sum(filtered portal) difficulty
          philmodjunk

          SUM(c_TimeTotal) will return the value of c_TImeTotal not a sum. It's the same thing as saying Sum ( 5) --which equals 5.

          Sum ( TODO::c_TimeTotal) will sum the related TODO records, if defined in Paycheck--but this ignores any portal filtering as this evaluates at the data level, not the layout level.

          You can get a portal total that reflects the portal filtering if you use this method:

          Define a summary field, sTotalTime in TODO and set it to compute the total fo c_TimeTotal.

          Place a second portal to TODO on your layout. Give it exactly the same portal filter, but specify that it be only one row in size.

          Put TODO::STotalTime inside this filtered one row portal. (You can make the portal borders invisible to make this look like any other field on your layout.

          • 2. Re: sum(filtered portal) difficulty
            tomswell

            Oh so silly ! ... best to walk away and come back.   I had done it right, just haven't dealt with time formatting much .

            4:30pm [ 12 hr format ] does not intuitivey come to mind as 16:30 hrs