Alpha Video Training
Results 1 to 5 of 5

Thread: Calc field on a report

  1. #1
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Calc field on a report

    I have created a report based on a set. In the detail section I have a number of calc fields the returns an if/then value. There are only ever 10 records to the report. It works fine on the first two rows, but the last 8 rows show the same value which are wrong. Attached is picture of the report.

    Why would I get correct value in the first two records and the wrong value (which is the same in every one) in the next 8
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Calc field on a report

    Not much information to work with. Does the set involve one-to-many links? If so, the calc fields in the details band get evaluated for each composite record in the set. Do the calc expressions involve fields from a "parent" table in your set? You may be getting duplicate results for the same reason you'd see duplicate field values if you dropped a field from a parent table into the details band. Perhaps review of the section on one-to-many sets in the Reports chapter of the User Guide will help you get this sorted.

    Furnish a working copy of the problem and we can check it for you.

  3. #3
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Calc field on a report

    Thanks Tom,

    The complexity and scope of my db is such that actually posting it would probably cause more discussion than the problem.

    I think my thoughts were more concerned with why two records can be correct and the others fail. I consider that abnormal behavior. However, it was a consistent flaw (result) so I presume my setup was too complex. I think your words confirm this.

    As always when things like this happen, I look at the construct and possible work arounds. Result has been a completely different approach. Flattened the table somwhat so I did not need to have so many connecting tables in the set, then wrote a script to fill some fields and result - perfect
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Calc field on a report

    While possible, I think it unlikely that the calc expressions "failed". Alpha was probably doing what you told it to, just not what you intended. Composite records in a one-to-many set will frequently produce unexpected repeating patterns in reports. Calc field that are "built on" composite records can do the same.

    In any case I'm glad you have it sorted.

  5. #5
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Calc field on a report

    I have found that when either a filter or order (mostly) is too long and the expression builder cannot resolve it, that records will also repeat (at random many times). And I am not referring to having necessarily a filter/order that exceeds the maximum length, just one that must be a bit too complex and due to timing or whatever, fails and produces multiple records sporadically (although exceeding the limits will produce similar issues).

    The remedy?? :) Punt! I usually reduce one or both until results are as expected and then add back in, changing the one I found to be the problem causer to either something else or a preprocessed one.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




Similar Threads

  1. Calc Field in report dissapearing ......
    By peterg000 in forum Alpha Five Version 10 - Desktop Applications
    Replies: 3
    Last Post: 03-30-2010, 06:56 PM
  2. Report Calc Field
    By Mortie in forum Alpha Five Version 5
    Replies: 1
    Last Post: 12-30-2003, 10:57 AM
  3. calc field in report?
    By Ludwig Beil in forum Alpha Five Version 5
    Replies: 2
    Last Post: 11-27-2002, 07:31 AM
  4. Calc Field in Report
    By Ed Barley in forum Alpha Five Version 5
    Replies: 5
    Last Post: 11-06-2002, 02:16 PM
  5. Calc Report Field
    By Thomas Holt in forum Alpha Five Version 4
    Replies: 4
    Last Post: 06-19-2001, 08:35 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
  •