Linking Data¶
Creating a data model, or defining relationships between Datalists is often one of the most important steps in building a model in Modelshop.
In this section we will discuss how to create relationships as well as some common tasks that can be solved with linking.
Creating a Link¶
Links can be one to one or one to many. Additionally, many to many relationships can be achieved by creating an intermediary table (join table).
Before creating a link, we need to identify the source of the link, as well as a target for the link. An important consideration is that the target of the link needs to be unique in it’s respective Datalist.
For example, let’s say we have 2 Datalists. The first is a list of employees, containing their name and title. , The second Datalist contains all possible titles at the company. It is fair to assume most titles have more than one employee attached to it (ie the company has 20 Vice Presidents). In this instance, if we wanted to create a relationship between these 2 Datalists, we would want the unique list (the list of titles), to be the target of our link, and the non unique list (the list of employees) to be the source.
To create a link, open the Link Wizard from the “Link” tab. Select your source field from the “From Datalist” and the target field in the “To Datalist”. To help determine the efficacy of the proposed link, you can review the summary stats for each field. Then select “Make Link”.
Alternatively, Modelshop will provide suggested links for the active “From Datalist”.
Using a Link¶
Modelshop links are two way. Here we will detail how to use a link from source to target and visa versa.
Source to Target¶
To use a link in a calculation, simply enter the field name followed by a .
then the name of the field you would like to access.
Example:
Target to Source (AKA Backlinks)¶
A “Backlink” field is automatically created on the traget Datalist whenever a link is established. This backlink field contains all of the records in the source datalist, that are linked to a specific record in the target datalist. The name of the field will by default be the name of the source datalist with “List” added to the end.
Example: