I believe sum() works on Number type data and you’re using Interval type. Have you tried turning the $Period into a number of minutes. You can then sum those, then turn them back nit hours/minutes or such.
Ideally, don’t do lots of calculation in the display expression. Instead use a user attribute to hold the computed value and them display that.
What is the value of the $MyNumber attribute, i.e. before it is used in the display expression?
Your ‘agent query’ looks wrong. Don’t you mean the agent action? However, that’s not how you sum the agents children.
The query finds notes that match the query, make an alias of each as a child of the agent. The agent’s action is performed upon each of those aliases. However, you want the agent to show the sum of the child $Period values. For that, set the agent’s $Rule [sic] to:
$MyNumber=sum(children,$Period)
The $MyNumber attribute for the agent should now hold that sum as an integer number. Now we add code to the same rule to make the overall display string:
$MyString = $Name+" – Total Time = "+floor($MyNumber/60)+"/"+mod($MyNumber,60)+" hours/minutes";
Lastly, in the display expression box on the text Inspector, you simply enter:
$MyString
Thus if the the sum in the agent $MyNumber were 310 (minutes), $MyString would be Test cell – Total Time = 5/10 hours/minutes.
Thanks so much. I got everything to work with a rule to set subtitle as x.xx hours. I will modify to get hours and minutes instead, which I couldn’t figure out how to do before.