Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

DCS evaluateWhereExpression: Difference between revisions

From Catglobe Wiki
Cg van (talk | contribs)
No edit summary
Cg van (talk | contribs)
Line 117: Line 117:
|}
|}


=== Example  ===
===== Example  =====


number dcsResourceId1 = DCS_getCurrentDcsResourceId();  
''number dcsResourceId1 = DCS_getCurrentDcsResourceId(); ''


number dcsResourceId2 = 123456;  
''number dcsResourceId2 = 123456; ''


string expression1 = "average(Single2) where true;";  
''string expression1 = "average(Single2) where true;"; ''


string expression2 = "min(Single2) where true;";  
''string expression2 = "min(Single2) where true;"; ''


DCS_use(dcsResourceId2);  
''DCS_use(dcsResourceId2); ''


print(DCS_evaluateWhereExpression(expression1));  
''print(DCS_evaluateWhereExpression(expression1)); //return average value of question Single2 ''


print(DCS_evaluateWhereExpression(expression2));
''print(DCS_evaluateWhereExpression(expression2)); //return minimum value of question Single2 ''

Revision as of 10:21, 20 December 2011

DCS_evaluateWhereExpression


Evaluate a WHERE expression

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