How to create a calucalted field that uses different tables

User ece72b21c8

12-08-2011 10:48:11

Hello,


in my project, I have two different tables. One table with properties of chemical substances and another table with coeficients.


Within the first table I'd like to create a calculated field that uses the values from the other table as well.


Is it possible to do something like this and if yes, how to do it?


 


Thank you


PS: I use the Instant JChem version 5.5.1

ChemAxon fa971619eb

12-08-2011 12:04:49

Hi, yes, this is possible using calcuated fields. But first you need to combine the two tables into a single data tree so that one is the parent and the other the child. You might already have done this, but if not then you need to


1. create a releationship between the 2 tables
http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/editing_database/editing_relationships.html


2. add the child to the parent in the data tree of the parent
http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/editing_database/editing_datatrees.html


Onc ethis is done then you can create a calcuated field in either entity (table) and include fields from the other table. I fthe relationship is one-to-one then this is pretty straight forward. If its one-to-many then you will probably want to agreggate the multiple values somehow (average?). All of this is possible. See here for details:
http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/editing_database/fields_calc.html


This animation may also help:
http://www.chemaxon.com/library/relational-form-building/


Tim