====== Importing data (Parameter database) ====== === Importing data from excel === {{ :import_pdb.png?550}} In short, importing data is done through the following steps. - In the right section of the screen, the user selects the file which contains the data to be imported. - The file is analysed by the database. For each sheet in the Excel file, a tab is created in the left section. All instances found for in each sheet are then listed in the leftmost column (Excel) of a table under the corresponding tab. - Each instance found in the Excel file must now either be matched to an instance already in the database (which will be overwritten) or to a new instance. The database column offers drop down menus where all database instances with the same name as the Excel instance are presented. To create a new instance rather than overwriting an existing instance, click the Create button. If there is an error associated with the import of a given instance, this error is listed in the rightmost column. For an explanation of common errors, see below. - If either a Excel or a database instance are selected, the bottom table will display their values. - When new or existing instances have been assigned to each Excel instance, click the Import button. **Importing an algorithm** When data is exported from the parameter database a column named Export Info is appended for each row. The Export Info fields contain the search tags of the instance from where the value is taken. Also, the GUID (global unified ID) of the instance is added to the cell as a comment. This way the database can find which rows belong to which instance when the data is re-imported into the database. A typical scenario would be when a lot of data needs to be inserted into the database. A user can then (1) create empty instances for the data, (2) export these instances to an Excel file, (3) fill in the data in the Excel file and (4) re-import it to the database. When the user has selected a file to import, the database will analyse the file and display its contents, before the data is imported. It will attempt to identify to which database instance each value belongs and suggest these as targets for the import. First the database will look in the Export Info column. If the column contains a comment with a GUID, and there is an instance in the database with the same GUID, this instance will be selected as the target. If there is no GUID, the database will see if there are tags written in the Export Info column. If there are instances in the database with the same name and the same set of tags, the database will suggest the first of these as the target. If there is no instance in the database with matching name and tag, the database will not suggest anything. The user has to manually either choose an instance or create a new one. **Errors and requirements** The database require that the parameters are defined in the database before values can be imported. For example, if an Excel file contains a parameter named Kd which depends on Element and there are values for Lead, Plutonium and Iodine the database must have a definition for a parameter with this name and with the same dependency. The dependency must contain indices for Lead, Plutonium and Iodine (but can of course contain many others). Some typical errors would be: - //There is no definition for the parameter X.// This means that there is no definition (for the selected project) with the name X. Note that the database names are case-sensitive. - //The dependencies are invalid for parameter X.// This message appears when the names of (and/or number of) dependencies do not match. - //There is no index Y in the database.// An index for a specific dependency is missing. ---- \\ [[parameter_database_wiki|Back]]