--- tags: - data collection alias: tutorial-datacollection-edc-parameters-calculated-examples timetoread: true description: "This documentation showcases expression examples for accessing and manipulating data" --- # Examples This page contains examples of expressions that CM MES supports. ## Simple Calculations Example of accessing a **Material** property and multiplying it: ```c# Material.PrimaryQuantity * 100 ``` Example of accessing a **Material** attribute: ```c# Material.Attributes.RetailPrice ``` Example of accessing a **Material** custom property: ```c# Material.Attributes.MyCustomProperty01 ``` Example of accessing a Material Characteristic: ```c# Material.MaterialCharacteristic.Characteristic01 ``` Example of accessing a **Resource** property with navigation: ```c# Material.Flow.Name ``` Example of accessing the current **Data Collection** parameters: ```c# // Specifying the sample and reading Parameters.Thickness.Samples[0].Readings[0].Value * Parameters.EtchRate.Samples[0].Readings[0].Value ``` Example of average of all samples and readings of the **Thickness** parameter: ```c# // Using double wildcard $average(Parameters.Thickness.**.Value) // Specifying the JSON structure $average(Parameters.Thickness.Samples.Readings.Value) ``` Example of maximum of all readings for the first sample of the **Thickness** parameter: ```c# $max(Parameters.Thickness.Samples[0].*.Value) ``` The value of the first reading for the first sample of the **Thickness** parameter: ```c# Parameters.Thickness.Samples[0].Readings[0].Value ``` Regarding grouping functions, support: **Maximum**, **Minimum**, **Average**, **Range**, **Standard Deviation**, **Sum**: ```c# // Maximum $max(Parameters.Thickness.Samples.Readings.Value) // Minimum $min(Parameters.Thickness.Samples.Readings.Value) // Average $average(Parameters.Thickness.Samples.Readings.Value) // Sum $sum(Parameters.Thickness.Samples.Readings.Value) // !! Standard deviation and Range are not yet supported, but the syntax will be the following !! // Standard deviation $stddev(Parameters.Thickness.Samples.Readings.Value) // Range $range(Parameters.Thickness.Samples.Readings.Value) ``` ## Referencing External Data Collections To reference an external **Data Collection** the syntax is similar, but you must add the `DC(MyDataCollection01)` at the start. So if you want to calculate the average of all the readings of the first sample from the Width parameter of the **Data Collection** CP_DC01, you would use the following expression: ```c# $average(DC(CP_DC01).Parameters.Samples[0].Parameters.Value) ```