1
2
3
4
5
6
7
8
9
10
11
12
// 3_1 버튼
this.btn_Exe3_1_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
    var nAvgM  = this.Dataset1.getCaseAvg("GENDER=='M'""SALARY");
    var nAvgW1 = this.Dataset1.getCaseAvg("GENDER=='W'""SALARY");
    
    // 0에서부터 -1(전부) 까지 false-> 값이 없는것은 0으로 포함해서 평균을 구함
    // true일 경우 default이기 때문에 위 처럼 해도됨
    var nAvgW2 = this.Dataset1.getCaseAvg("GENDER=='W'""SALARY",0-1false);
    trace("Man Avg=" + Math.round(nAvgM, 2+ " : Woman Avg=" + nAvgW1 + " : " + nAvgW2);
    this.txtRtn1.set_value("Man Avg=" + Math.round(nAvgM, 2+ " : Woman Avg=" + nAvgW1 + " : " + nAvgW2);
};
cs

 

컬럼 전체 합해서 평균 계산

Salary+Bonus AVG=5278.75

 

1
2
3
4
5
6
7
// 3_2 버튼
this.btn_Exe3_2_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
    var nAvg = this.Dataset1.getAvg("SALARY+BONUS");
    trace("Salary+Bonus AVG=" + nAvg);
    this.txtRtn1.set_value("Salary+Bonus AVG=" + nAvg);
};
cs

 

 

오름차순 내림차순 표현법

1
2
3
4
5
6
7
8
9
10
11
12
13
// 3_3 버튼
this.btn_Exe3_3_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
    // 내림차순
    this.Dataset1.set_keystring("S:-HIRE_DATE");    
};
 
this.Button00_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
    // 오름차순
    this.Dataset1.set_keystring("S:+HIRE_DATE");
};
 
cs

 

 

현재 갯수 가져오기

1
2
3
4
5
6
7
8
9
10
11
// 3_5
this.btn_Exe3_5_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
    // 현재 필터링 표현된 로우 갯수
    var nCnt   = this.Dataset1.getRowCount();
    
    // 현재 필터링 되지 않은 로우 갯수
    var nCntNF = this.Dataset1.getRowCountNF();
    trace(nCnt + " : " + nCntNF);
    this.txtRtn1.set_value(nCnt + " : " + nCntNF);
};
cs