_UPDATE_STATS_LIST_ Method

Outputs the updatestatslist JavaScript function on the Dimensions page

Syntax

CALL SEND(OBJID,'_UPDATE_STATS_LIST_');

Details

The updatestatslist function modifies the list of available and selected statistics as the user makes statistic selections for the report display.

Example

The following output is produced:
function updatestatslist(select) {
pos = 0;
num = 0;
newlength = 0;
var arrayname = "";
var analysistype = "";
var arrayofstats = "";
for (i=0; i < select.options.length; i++) {
   if (select.options[i].selected) {
      num=num+1;
      arrayname = select.options[i].value+"STATS";
      analysisarray=eval(arrayname);
      if (analysistype.indexOf(analysisarray[0])==-1 ) {
         analysistype=analysisarray[0] +"," +analysistype;
      }
   }
}
if (analysistype.substr(eval(analysistype.lastIndexOf(",")+1), 1)=="") {
   analysistype=analysistype.slice(0,analysistype.lastIndexOf(","));
}
arrayoftypes = analysistype.split(",");
arrayoftypes.sort();
document.mf.as.options.length=0;
document.mf.s.options.length=0;
if (num > 1) {
   for (i=0; i < arrayoftypes.length; i++) {
      if ( i==0 ) {
         arrayname = eval(arrayoftypes[0]+"desclist");
         pos = arrayname.length;
         for ( j=0; j < arrayname.length; j++) {
         document.mf.as.options[j] = new Option(statslabellist[arrayname[j]], 
            arrayname[j]);
         }
      }
      else if (arrayoftypes[i]=="nunique") {
         arrayname = eval( arrayoftypes[i] +"desclist");
         document.mf.as.options[pos] = new Option(statslabellist[arrayname[0]], 
            arrayname[0]);
      }
   }
   document.mf.s.options[0] = new Option("*MIXED SELECTIONS", "MIXED");
}
else if ( num==1 ) {
      k=0;
      arrayofstats=eval( arrayoftypes[0] +"desclist");
      for (i=0; i <select.options.length; i++) {
         if (select.options[i].selected) {
            arrayname = eval(select.options[i].value+"STATS");
            for ( j=1; j < arrayname.length; j++ ) {
               document.mf.s.options[j-1] = new Option(statslabellist[arrayname[j]], 
                  arrayname[j]);
            }
         }
      }
      for (i=0; i < arrayofstats.length; i++ ) {
         var repeat="false";
         for (j=1; j < arrayname.length; j++) {
            if (arrayofstats[i]==arrayname[j]) {
               repeat="true";
               break;
            }
         }
         if (repeat=="false" && arrayofstats[i]!="") {
            document.mf.as.options[k] = new Option(statslabellist[arrayofstats[i]],
               arrayofstats[i]);
            k++;
         }
      }
}
}