function(){var Widgeta=_g().parameterEl.getWidgetByName("org"); var org = Widgeta.getValue(); var Widgetb=_g().parameterEl.getWidgetByName("V_MONTH"); var V_MONTH = Widgetb.getValue(); var a = this.category; var sql= "select VBUNAME, VMONTH, round(SUM(NRECLEFT)/(select SUM(NRECLEFT) from DM_REC_MONTH where DM_REC_MONTH.VMONTH = a.VMONTH),2)*100||'%' AS A1 from DM_REC_MONTH a where VMONTH ='" +V_MONTH+ "' AND VBUNAME = '"+a+"' AND '"+org+"'='00' GROUP BY VBUNAME, VMONTH" +" UNION ALL "+ "select UNITSHORTNAME, VMONTH, round(SUM(NRECLEFT)/(select SUM(NRECLEFT) from DM_REC_MONTH where DM_REC_MONTH.VMONTH = a.VMONTH AND DM_REC_MONTH.VBUCODE = '"+org+"'),2)*100||'%' AS A1 from DM_REC_MONTH a LEFT JOIN DIM_ORG ON DIM_ORG.UNITCODE = a.VORGCODE where VMONTH ='" +V_MONTH+ "' AND UNITSHORTNAME = '"+a+"' AND '"+org+"'IN ('05','04','03','02','01')" +" AND VBUCODE ='"+org+"'"+ "GROUP BY UNITSHORTNAME, VMONTH" +" UNION ALL "+ "select UNITSHORTNAME, VMONTH, round(SUM(NRECLEFT)/(select SUM(NRECLEFT) from DM_REC_MONTH where DM_REC_MONTH.VMONTH = a.VMONTH AND DM_REC_MONTH.VORGCODE = '"+org+"'),2)*100||'%' AS A1 from DM_REC_MONTH a LEFT JOIN DIM_ORG ON DIM_ORG.UNITCODE = a.VORGCODE where VMONTH ='" +V_MONTH+ "' AND UNITSHORTNAME = '"+a+"' AND '"+org+"' NOT IN ('05','04','03','02','01')" +" AND VORGCODE ='"+org+"'"+ "GROUP BY UNITSHORTNAME, VMONTH"; var res=FR.remoteEvaluate('sql("test","'+sql+'",3,1)'); return res+this.category+"|"+this.seriesName+":"+Math.round(this.value); }
我不太懂var 的内容和select的where条件 |