0

Use choice fields in a formula field

Hello,

Here is what I have:

- A number field called (Bedrag) where I put in a value, the number field is in an parent table called (Kosten).

- A choice field where I have 6 options in parent table (Kosten)

- 6 formula fields in an different parent table called (vastgoed)

I make a new record and I put a value in number field (Bedrag), then I choose one of the choice field options corresponding to my record, then I would like have the sum of the values that I put in number field (Bedrag) of all the corresponding records in the corresponding formula field (vastgoed).

Hopefully I made myself clear ;-)

Many thanks.

Ronald Schuyten

7 replies

null
    • Fred
    • 9 mths ago
    • Reported - view

    Thanks for the table names. Very helpful.

    Are Kosten and vastgoed related?

    Are the six choices in the choice field related to the six formula fields? Can you post the code of one of the formula fields?

      • Ronald_Schuyten
      • 9 mths ago
      • Reported - view

      Fred, Thanks for your reply.

      Kosten and Vastgoed are indeed related, aswell de six choices to the formula fields.

      Here's the code I came up to, probably completely wrong ;-)

      "Renovatie" is one of the six choices.

      if text('Oplijsting kosten'.Kostenpost) = "Renovatie" then sum('Oplijsting kosten'.'Bedrag BTWin.')
      end

      Thanks for your reaction.

      • Fred
      • 9 mths ago
      • Reported - view

       The code looks ok. What is happening?

      • Business Analyst
      • Terry_Hopper
      • 9 mths ago
      • Reported - view

      Hi  

      This is a formula to go in the Property (Vastgoed) table, right? And you want to have a sum of the Amounts (Bedrag) for each of the types of costs (specified in the Kostenpost field) in your Cost List subtable (Oplijsting Kosten)?

      In this case, in the Property (Vastgoed) table, you'll need formula fields like this:

      sum('Oplijsting kosten'[text(Kostenpost) = "Renovatie"].'Bedrag BTWin.')

      Let me know if that works.

      Regards, Terry.

      • Ronald_Schuyten
      • 9 mths ago
      • Reported - view

      Hi  

      Actually this line of code does nothing.

      I'm sorry I made myself not so clear (language barrier I suppose ;-) but explianed it like it suppose to be.

      Thank you very much for your help.   

      • Ronald_Schuyten
      • 9 mths ago
      • Reported - view

      Hi   This line of code you provided me workes like a charm.

      Thank you very much for your time.

      And if   and/or  visiting Belgium, there will be on my account, a good cold glass of Belgium beer waiting for you guys! ;-)

      • Business Analyst
      • Terry_Hopper
      • 9 mths ago
      • Reported - view

      Hi   ,

      You're welcome!

      If it is all working now, please can you mark this thread as "answered".

      Thanks.

      Terry.

Content aside

  • Status Answered
  • 9 mths agoLast active
  • 7Replies
  • 116Views
  • 3 Following