Derivations
derivations are created in the methods tab found at metadata version level and referenced at section (itemref) level to apply a derivation to a field, complete the ‘folder’ and ‘form’ properties in the method to specify the form that contains the section (item group) with the itemref and the folder where the form is contained you can apply the derivation to all instances of the question within a specified folder or across all folders by setting 'apply to all fields' to 'true' if set to 'true', the 'form' property should not be populated the 'folder' property should be populated if the derivation should only be applied within a particular folder; it should be left blank if the derivation should be applied to all instances of the item across all folders a derivation is built up from a series of derivation steps multiple derivation steps can be defined by creating additional custom elements the derivation steps will be performed in the order that they appear within the method this order can be changed by using the 'ordinal' property within each derivation step note a derivation can only be created if you have not entered the ‘custom function name’ property, as this changes the method from a derivation to a custom function (see custom functions) example derivation this example shows how to create a derivation that calculates the age based on the current date and the 'date of birth' field from the asset group, click create method select the medidata rave properties select the form containing the variable that the derivation will be applied to click add derivation step group create a data value derivation step for the current date create a data value derivation step for the date of birth create a data value derivation step to calculate age by selecting the age step function attach the method to the 'age' question by selecting associate under context properties > method custom functions a custom function is piece of code added to a medidata rave project to extend the functionality of a derivation or edit check some scenarios that require the use of custom functions include looping through repeating forms/ log lines on a form deriving a subject id that includes the site number performing complex calculations custom functions are defined within methods at metadata version level the name of the custom function should be entered into the 'custom function name' property no other properties or custom elements should be used when defining a custom function the custom function is defined within the formal expression within the method and contains the following components text contains the code context must be in one of the following formats rave\ c# rave\ vb rave\ sq note these options are the only options supported by rave the 'rave' portion indicates that this formal expression should be used for the custom function the portion after the colon indicates which language the custom function is written in custom functions can be used within derivations and edit checks when referring to the custom functions, the value specified in the 'custom function name' property should be used