Difference between revisions of "DCS evaluateWhereExpression"
(→DCS_evaluateWhereExpression) (Tag: visualeditor) |
(→DCS_evaluateWhereExpression) (Tag: visualeditor) |
||
Line 4: | Line 4: | ||
Evaluate a WHERE expression. See also [[DCS evaluateWhereExpressions]] for faster evalution of multiple expressions. | Evaluate a WHERE expression. See also [[DCS evaluateWhereExpressions]] for faster evalution of multiple expressions. | ||
+ | |||
+ | This function is an alias to EvalWhere in [[DataCacheSpecification class]]. | ||
=== Syntax === | === Syntax === |
Latest revision as of 09:57, 5 December 2018
DCS_evaluateWhereExpression
Evaluate a WHERE expression. See also DCS evaluateWhereExpressions for faster evalution of multiple expressions.
This function is an alias to EvalWhere in DataCacheSpecification class.
Syntax
DCS_evaluateWhereExpression(whereExpression)
Arguments
- whereExpression: is string. ex: "selectColumn(Id) where true;"
Return value
Execute the where expression and return an object depending on where expression:
WhereExpression |
Return type |
average |
empty |
count |
number |
max |
number |
median |
number |
min |
number |
percentile |
number |
quantile |
number |
select |
empty |
selectColumn |
array |
stdev |
number |
sterr |
number |
sum |
number |
variance |
number |
Example
number dcsResourceId1 = DCS_getCurrentDcsResourceId();
number dcsResourceId2 = 123456;
string expression1 = "average(Single2) where true;";
string expression2 = "min(Single2) where true;";
DCS_use(dcsResourceId2);
print(DCS_evaluateWhereExpression(expression1)); //return average value of question Single2
print(DCS_evaluateWhereExpression(expression2)); //return minimum value of question Single2