---
title: "system.mes.spc.analysis.executeMiscCalculation(settings, miscCalcName)"
id: "system-mes-spc-analysis-executemisccalculation-settings-misccalcname"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/system-mes-spc-analysis-executemisccalculation-settings-misccalcname"
updated: 2026-07-31T14:57:58Z
---

# system\.mes\.spc\.analysis\.executeMiscCalculation\(settings, miscCalcName\)

**Sepasoft MES Module Suite**

### system.mes.spc.analysis.executeMiscCalculation(settings, miscCalcName)

Perform a previously defined miscellaneous calculation. If calculations other than the built-in calculations, such as PPM, are needed, then they can be defined in the Misc. Calculation section in the MES production model.

Syntax

system.mes.spc.analysis.executeMiscCalculation(**settings, miscCalcName**)

* Parameters

[SPCSettings](/articles/user-manual/SPC-Settings)  **settings** - An instance of a [SPCSettings](/articles/user-manual/SPC-Settings) object that defines the samples to perform the calculation.

[String](/articles/user-manual/Data-Types-and-Formats)  **miscCalcName** - The name of the miscellaneous calculation, that has been previously defined in the Misc. Calculations, to perform.

* Returns

[MiscCalcEvent](/articles/user-manual/MiscCalcEvent) - The MES object created for the execution of the miscellaneous calculation.

* Scope

All

Code Example
 

```python
locationPath = 'Enterprise\El Dorado Hills\Packaging Area\Packaging Line 1\Inspection Station 1'

startDate = system.mes.spc.analysis.formatDate(system.date.addHours(system.date.now(), -2))
endDate = system.mes.spc.analysis.formatDate(system.date.now())

definitionName = 'Case Inspection'
attribute = 'Fill Level'

controlLimits = 'CpPp LSL,CpPp USL'
signals = ''
dataFormatName = 'Process Capability and Performance'
filters=''

spcsettings = system.mes.spc.analysis.createSettings(definitionName, attribute, filters, controlLimits, signals, dataFormatName)
filter = spcsettings.encodeList(['FromDate='+startDate,'ToDate='+endDate,'Location='+locationPath])
spcsettings.setFilters(filter)

results = system.mes.spc.analysis.executeMiscCalculation(spcsettings, 'Cppp')
print 'CPK', results.getValue('Cpk')
print 'PPK',results.getValue('Ppk')
```



```
>>> 
CPK 0.0689333333333
PPK 0.0701882527634
>>>
```


**Sepasoft MES Module Suite**