# Thread: Total using negative number

1. ## Total using negative number

I’m using expression; total(Time_Hx->Accrvaca,GRP->2) to total a column of numbers on a report and one of the numbers in the Accrvaca field is a negative. This expression ignores that number. If I change it to a positive, no problem, it will total properly.
Would appreciate any help.
Thanks
Don

2. ## RE: Total using negative number

Don,

What do you want to do with the negative number?

Suggestions might be easier if you could post the expression as it is presently written.

Dave

3. ## RE: Total using negative number

Don,

I built a simple report based on a single table.

Used a single group break.

Created a group subtotal and dropped it in the group footer.

The total figure correctly accounts for negative numeric values in each group.

How is this model different from yours ?

-- tom

4. ## RE: Total using negative number

Dave & Tom,
I have various records with field values of accrued vacation figures “Accrvaca” which I total up using “total(Time_Hx->Accrvaca,GRP->2)” in group 2 footer. The negative number is also entered thru an embedded browser so I could correct any discrepancies. The negative number is entered using “( )” around the number, in the set it does show “-“ in front of the number, which seems proper. I don’t see much difference in your test case. Still doesn’t make much sense. It just doesn’t accept the minus. Thanks..

5. ## RE: Total using negative number

Your reference to entering negative numbers with parenthesis around them concerns me. Is it possible that you don't actually have a numeric field but only a character field?

Version 5 has added a feature where it tries to convert fields as necessary when in expressions. Possibly this is why it recognizes the positive numbers but not the negative? It may think the negative number really is a character value if it's in a character field.

6. ## RE: Total using negative number

Don,

If you enter the negative number enclosed by parentheses as in (-n) it results in a positive number. If you enter (n) it is treated as a negative number.

Try entering the number as -n (without the parentheses), which should be treated as a negative.

Dave

7. ## RE: Total using negative number

I reentered the number as “-n”, no effect, it still could not detect it. Tried “(-n)”, it came up as a positive which is expected and totaled as a positive. It almost seems like it is treating it as a character when I try to enter it as a negative. Don

8. ## RE: Total using negative number

Don,

I appreciate what you are saying when you say "It almost seems like it is treating it as a character when I try to enter it as a negative", but that shouldn't happen (I'm reluctant to say 'never'). Could you post your calculation so it can be disected?

Dave

9. ## RE: Total using negative number

Don,

Can you post tables and dictionaries here with actual names purged or scrambled?

I'm beginning to think this may be related to the group level, but would like to verify it misbehaves here before reporting to Alpha.

-- tom

10. ## RE: Total using negative number

Don, theory refuted. I just added a second group break and separate subtotals for group2 and for group1 continue to function correctly. Negative values in the detail band are correctly handled.

-- tom

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•