>>Order of variables:
>>1. one to keep the group expression, initialize to non-existing value (so it is different from the first group), assign group expression
>>2. rvGroupHasChanged, initialize to .f., assign FirstVariable=GroupExpression
>>3. third one goes to keep the totals of the rounded values per person (or just for grand total)
>
>Dragan,
>
>I cannot get it to work without UDF.
>Can you provide an exact description or sample report
>how this particular case can be implemented?
I'll have to do this a bit as off the top of my head, I've done it on another machine which is sold in the meantime :). Yea, I know, I should have a backup - and I do, but I gave it to the guy who will maintain the thing.
The basic layout is like this:
first variable rvGroupExpr
inital value = non-existent value
assign value = group expression
reset at group, calculate nothing
second variable rvIsGroup
initial value .f.
assign value = rvGroupExpression # groupExpression
reset at end of report, calculate nothing
third variable, rvTotal
initial value=0
assign value = iif(rvIsGroup, < your hours total per person comes here >, 0)
calculate total, reset at outer group or end of report
You may try different ordering of the first two variables, and the initial value for the rvIsGroup - it should be .t. only when group expression changes, and the third should add only when it becomes .t., i.e. only once in a group. I think that's all - unfortunately, I can't be exactly sure if this reconstruct is quite correct. Wish I had a copy.