1 Reply Latest reply on Jan 22, 2012 2:06 AM by Sorbsbuster

    [newbie] help with calculation

    NathanRidge

      Title

      [newbie] help with calculation

      Post

      Hello,

      I am new to Filemaker so please forgive me for asking such a basic question. I am trying to figure out how to do what seems to me a very simple calculation:

      I have two tables, A and B. A has a field A::x, of type Number, and B has a field B::x, also of type Number.

      Now I would like to add a field A::y, of type Calculation, where the calculation is "the number of records in table B whose B::x value is equal to the value of A::x in this A record".

      Can someone tell me how to do this calculation? I tried to to " = Sum ( If ( B::x = A::x ; 1 ; 0 ) )" but it doesn't work, I just get a question mark as the value for the field.

      Thank you for your help,

      Nate

        • 1. Re: [newbie] help with calculation
          Sorbsbuster

          The logic you are using in the If ( B::x = A::x ; 1 ; 0 ) should be in a relationship between the two tables.  So, one way would be:

          - set up a relationship, Table A to Table B, matching those two values
          - in Table A set a calculation, Count ( ThatRelationshipName::SomeFieldInTableBThat IsAlwaysCompleted )