Alpha Video Training
Results 1 to 10 of 10

Thread: Total using negative number

  1. #1
    Member
    Real Name
    Don Gunther
    Join Date
    Feb 2002
    Posts
    36

    Default 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. #2
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default 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. #3
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default 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. #4
    Member
    Real Name
    Don Gunther
    Join Date
    Feb 2002
    Posts
    36

    Default 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. #5
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default 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. #6
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default 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. #7
    Member
    Real Name
    Don Gunther
    Join Date
    Feb 2002
    Posts
    36

    Default 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. #8
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default 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. #9
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default 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. #10
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default 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

Similar Threads

  1. negative number input
    By kevinsmith in forum Alpha Five Version 6
    Replies: 2
    Last Post: 10-31-2004, 02:21 PM
  2. Transposing a negative number to a blank field
    By Charles Scott in forum Alpha Five Version 5
    Replies: 2
    Last Post: 02-16-2004, 04:12 AM
  3. Correct total on the number of entries
    By helen forge in forum Alpha Five Version 5
    Replies: 1
    Last Post: 10-09-2002, 01:43 PM
  4. Negative Number Instead of Positive Number
    By forskare in forum Alpha Five Version 4
    Replies: 3
    Last Post: 01-02-2002, 09:28 AM
  5. Negative Number Display
    By JohnZaleski in forum Alpha Five Version 4
    Replies: 6
    Last Post: 04-24-2001, 04:48 AM

Bookmarks

Posting Permissions

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