hi i am also new to fm, but try this
B_type = Killo or Qty (drop down menu)
Price_k = price for killo "field"
price_q =price for 1 p "field"
amou_killo = how many killos "field"
amou_qty = how many qtys " field"
create total "calculation" field. then you put, case ( B_type="killo": price_k*amou_killo; B_type="qty": price_q*amou_qty:0)
thanks for your message.
But this way is not good, because I'll have many more fields. And I cannot add more fields to my database.
You've stated you cannot add more fields to your db. I hope you can change the Calculaltion field???
If so, set it up as follows:
If ( Table::unit = "piece" ; Table::quantity of pieces * Table::price ; If ( Table::unit = "kilo" ; Table::weight * Table::price ; "" ) )
Simple If that says if the value of unit is "piece", then calc it out using quantity times price, else if unit is "kilo", then calc it out as weight times price, otherwise leave the field blank (the "" at the end).
If you can define or redefine calculation fields, you can also add more fields to your database, but your last post suggests that you may have multiple fields where a related table of records would do better and also reduce the total number of fields defined in your table.