Professional Web Applications Themes

Conditional sum? - FileMaker

FMP6, MacOSX.2 I've created a calc field using the aggregate Sum(score) to give me a "total points scored" for all related records in a self-join. I then created a checkbox that, if checked, I want the score from that particular record omitted from the Sum calc (but I want the score preserved so I can't have the checkbox zero out the score field). Is this possible? The only way I can think of seems clunky: create scoreForSum calc = Case(omit = "true","",score) I would then use Sum(scoreForSum) to obtain "total points scored". As I said, it seems clunky with the ...

  1. #1

    Default Conditional sum?

    FMP6, MacOSX.2

    I've created a calc field using the aggregate Sum(score) to give me a "total
    points scored" for all related records in a self-join. I then created a
    checkbox that, if checked, I want the score from that particular record
    omitted from the Sum calc (but I want the score preserved so I can't have
    the checkbox zero out the score field). Is this possible?

    The only way I can think of seems clunky: create scoreForSum calc =
    Case(omit = "true","",score)

    I would then use Sum(scoreForSum) to obtain "total points scored".


    As I said, it seems clunky with the extra field, so I was wondering if there
    is a better way.

    TIA,

    Fred

    Fred Guest

  2. #2

    Default Re: Conditional sum?

    That's pretty much it.

    If the checkbox is formatted with a VL whose contents are 1 and 0 (or even
    1), and you squish it to show only the 1 part, and it's a number field, you
    can shorten to:

    omit*score

    --
    John Weinshel
    Datagrace
    Vashon Island, WA
    (206) 463-1634
    Associate Member, Filemaker Solutions Alliance


    "Fred" <fredr1cox.net> wrote in message
    news:BBC322C8.C65B%fredr1cox.net...
    > FMP6, MacOSX.2
    >
    > I've created a calc field using the aggregate Sum(score) to give me a
    "total
    > points scored" for all related records in a self-join. I then created a
    > checkbox that, if checked, I want the score from that particular record
    > omitted from the Sum calc (but I want the score preserved so I can't have
    > the checkbox zero out the score field). Is this possible?
    >
    > The only way I can think of seems clunky: create scoreForSum calc =
    > Case(omit = "true","",score)
    >
    > I would then use Sum(scoreForSum) to obtain "total points scored".
    >
    >
    > As I said, it seems clunky with the extra field, so I was wondering if
    there
    > is a better way.
    >
    > TIA,
    >
    > Fred
    >

    John Weinshel Guest

  3. #3

    Default Re: Conditional sum?

    I think that should be:

    (not omit) * score

    assuming that checking the box means omit = 1 and you don't want to count it
    in your sum.

    "John Weinshel" <johndatagrace.biz> wrote in message
    news:vprr5q496i3u42news.supernews.com...
    > That's pretty much it.
    >
    > If the checkbox is formatted with a VL whose contents are 1 and 0 (or even
    > 1), and you squish it to show only the 1 part, and it's a number field,
    you
    > can shorten to:
    >
    > omit*score
    >
    > --
    > John Weinshel
    > Datagrace
    > Vashon Island, WA
    > (206) 463-1634
    > Associate Member, Filemaker Solutions Alliance
    >
    >
    > "Fred" <fredr1cox.net> wrote in message
    > news:BBC322C8.C65B%fredr1cox.net...
    > > FMP6, MacOSX.2
    > >
    > > I've created a calc field using the aggregate Sum(score) to give me a
    > "total
    > > points scored" for all related records in a self-join. I then created a
    > > checkbox that, if checked, I want the score from that particular record
    > > omitted from the Sum calc (but I want the score preserved so I can't
    have
    > > the checkbox zero out the score field). Is this possible?
    > >
    > > The only way I can think of seems clunky: create scoreForSum calc =
    > > Case(omit = "true","",score)
    > >
    > > I would then use Sum(scoreForSum) to obtain "total points scored".
    > >
    > >
    > > As I said, it seems clunky with the extra field, so I was wondering if
    > there
    > > is a better way.
    > >
    > > TIA,
    > >
    > > Fred
    > >
    >
    >

    Glenn Schwandt Guest

Similar Threads

  1. conditional format
    By Jim Franklin in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 2
    Last Post: January 27th, 08:58 PM
  2. Conditional query
    By DuLaus in forum Macromedia ColdFusion
    Replies: 3
    Last Post: March 30th, 11:09 AM
  3. Conditional compilation
    By Douglas Harter in forum PERL Beginners
    Replies: 4
    Last Post: November 6th, 05:50 PM
  4. Conditional Value Lists
    By Jean Biver in forum FileMaker
    Replies: 2
    Last Post: August 21st, 11:43 PM
  5. Conditional Constraint?
    By Howard J. Rogers in forum Oracle Server
    Replies: 9
    Last Post: December 24th, 02:52 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139