本文介绍了Excel /数学运算/ DataTable行上的表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ckquote class =FQ>

ckquote class="FQ">

Quote:
</div>pre></blockquote>
Expression for Sigma and CpK
Input
DataTable1 --- table1

|Parameter Name| Lower |Upper   |point90      |point10     |point50    |
  Diff_IC[1]   |  1.5  |2.5     |0.1471839    |0.137499005 |0.141139999 |
  Prog_IC[2]   |-10    |10000000|0.148519993  |0.137592003 |0.141236007 |
  Nam_IC[3]    |-64    |64      |0.157493005  |0.117183459 |0.141788006|
  ADCI_N[1 ]   |-0.8   |-0.1    |0.138519993  | 0.117592003|0.142398   |


Output
|Parameter Name| Lower |Upper    |point 90     |point10    |point50  |Sigma       |CpK |
  Diff_IC[1]   |  1.5  |2.5      |0.147183999  |0.137499005|0.141139999 |            |    |
  Prog_IC[2]   |-10    |10000000 |0.148519993  |0.137592003 |0.141236007|            |    |
  Nam_IC[3]    |-64    |64       |0.157493005  |0.117183459|0.141788006|             |    |
  ADCI_N[1 ]   |-0.8   | -0.1    |0.138519993  |0.117592003 |0.142398   |            |    |


Formula:
Sigma = (P90 point-P10 point)/2.56
Cpk =  Minimum|[  (P50 point - Lower) / 3 (sigma), (upper - P50 pint)  / 3 (sigma)]|

推荐答案

DataTable dtDemo =  new DataTable();
dtDemo.columns["Sigma"].readonly = false;
for(int i =0 ; i < dtDemo.rows.count; i++)
{
	dtColumns.rows[i]["Sigma"] = Convert.ToDouble(dtColumns.rows[i]["Upper"]) - Convert.ToDouble(dtColumns.rows[i]["Lower"]);
// here i just given one demo u need to change as per your requirement
}


DataColumn sigma = table1.Columns.Add("Sigma", typeof(double));
DataColumn cpKL = table1.Columns.Add("CpKL", typeof(double));
DataColumn cpKR = table1.Columns.Add("CpKR", typeof(double));
DataColumn cpK = table1.Columns.Add("CpK", typeof(double));


sigma.Expression="(Convert(point90,'System.Double')-Convert(point10,'System.Double'))/2.56";
cpKL.Expression="(Convert(point50,'System.Double')-Convert(LSL,'System.Double'))/(3.0*sigma)";
cpKR.Expression="(Convert(USL,'System.Double')-Convert(point50,'System.Double'))/(3.0*sigma)";
cpK.Expression = "IIF(cpKL < cpKR, cpKL, cpKR)";


这篇关于Excel /数学运算/ DataTable行上的表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 04:44