3 Replies Latest reply on Mar 12, 2015 4:01 PM by philmodjunk

    Need help with a calculation

    shae1725

      Title

      Need help with a calculation

      Post

      Needing a little help!
      I have four fields with the following calculation,
      Probably doesn't need explaining but what it does is check all four fields contents are less than zero then populate them all with a value entered into any one of the fields.
       
      Let (
                L = List (Field1 ; Field2 ; Field3 ; Field4) ;
                Case ( Get ( RecordNumber ) = 1 ;
                               Case ( top  ≤  "0" ; Get ( ActiveFieldContents ) ;                        
                               Self );
               ))
       
      I have redesigned my table and need another argument added to the above, but I am stuck!
      I have a field in the same table called List, it contains a list of four values which I want entered into each of the above 4 fields. but I still want to be able to manually edit any of the 4 fields values, also if the field List changes I want the calculation to update the fields with the new values 
       
      I know to use  GetValue ( List ; 1 )  for field1  GetValue ( List ; 2 ) for field2 etc
       
      thanks in advance
       

        • 1. Re: Need help with a calculation
          philmodjunk

          what is "top" in your calculation?

          Why is it important to check to see if this is the first record in your found set? (Get ( RecordNumber ) = 1 )

          And it looks like you need a related table for this data instead of 4 separate fields. That change will make it much simpler to adjust for cases where you need more than 4 values as adding more values will require that you redefine your calculation where adding another record is just a data entry task.

          • 2. Re: Need help with a calculation
            shae1725

            sorry top should say field1, I changed the names on the calculation before I copied to the forum for easier reading

            your second point. I have no idea someone on this forum gave me this calculation when I requested help,it works but I did wonder why (Get(RecordNumber) was being used.

            I dont need more than four values

             

            • 3. Re: Need help with a calculation
              philmodjunk

              Hmmm, but:

              check all four fields contents are less than zero then populate them all with a value entered into any one of the fields.

              Doesn't make sense when I read that. If "all four fields" are less than zero, then how can it enter a value from "any one of the fields"?

              And what does this mean?

              also if the field List changes I want the calculation to update the fields with the new values

              That's the phrase that had me thinking you might be planning to work with more than 4 values here in the future...

              Perhaps you can give some examples with real values to show what you are attempting to set up?