Hello,
I have five consecutive columns filled with values (columns A to E). From this, I extract the mean values and the standard deviations for each row using the X-function sum(A:E)_mean in col(F) and sum(A:E)_sd in col(G) (see below).
My problem is the following:
I would like to mask entirely one (or more) of the initial columns (A to E) if it contains, between the rows 5 and 15 only, at least one value which is too far from the calculated mean (for example the outlier can be ">(col(F)+col(G))" (mean+sd) and "<(col(F)-col(G))" (mean-sd).
With the command window, this works with the following code:
for(int ii=5; ii<=15; ii++)
{
double dLower = col(F)[ii]-col(G)[ii]; // mean-sd
double dUpper = col(F)[ii]+col(G)[ii]; // mean+sd
for(int jj=1; jj<=5; jj++)
{
double dOutlier = col($(jj))[ii]; // get cell value
if(dOutlier<dLower || dOutlier>dUpper)
{
wcellmask irng:=col($(jj)); // mask the cell
}
}
};
However, I don't want to use the command window but I want to implement this code as a X-function in all 5 columns. The goal behind this is to run automatically the code every time I import new data (I use a data connector) without any human intervention. Is there a way to do such a thing?
It looks like it is possible to mask cells with a condition intracolumn but not intercolumn.
Thanks for your help.
Best regards,
Greg