4 Replies Latest reply on Apr 30, 2009 12:22 PM by philmodjunk

    Filed Calculation Issue

    cmjones

      Title

      Filed Calculation Issue

      Post

      Hi, I have a field that I want to display a certain calculation, but because of my limited knowledge I can't figure out how to set it up. The field already displays an existing calculation, but necause of some changes being made, I need to modify it if possible. The current calculation simply counts the number of records with a field containing a specified value (the value is specified when the user slects an option from a pop-up menu:

       

      Count(Subject 1::Q_Rec_ID)

       

      What I need to do now is take that count, and then subtract the number of records where the field CME_Q contains the value "CME" in order to get the final number value to display in the field. Can anyone shed some light on how I might be able to do this?

       

      Thanks! 

        • 1. Re: Filed Calculation Issue
          philmodjunk
            

          Define a new relationship or modify your existing one. (I can't tell which option is best from just the info in your post.)

          Right now you probably have two fields, one from each table set as match fields in your relationship. You should see something like:

           

          Maintable::IDfield--=--subject 1::Q_Rec_ID

           

          I don't know the name of the table and field on the left hand side so I've used generic labels for that.

           

          In Maintable, add a calc field that returns the text "CME", I'll call it "CMEKey"

           

          Now set up a relationship that matches your two tables like this:

           

                  IDfield = Q_Rec_ID

          AND CMEKey ≠ CME_Q

           

          Now use this new or modified relationship in your count function.

           

          (To edit a relationship, double click its line in the relationship graph.)

          • 2. Re: Filed Calculation Issue
            comment_1
              

            Try:

             

            Count ( Subject 1::Q_Rec_ID ) - ValueCount ( FilterValues ( List ( Subject 1::CME_Q ) ; "CME" ) ) 

            • 3. Re: Filed Calculation Issue
              cmjones
                 Thank you, that seems to be the most simple way of doing this!
              • 4. Re: Filed Calculation Issue
                philmodjunk
                   What a great idea! Thanks Comment, that taught me a new trick!