帮忙看一下标签自定义的代码

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条件

孟祥运 发布于 2019-3-4 13:24
1min目标场景问卷 立即参与
回答问题
悬赏:0 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
1
axingLv6专家互助
发布于2019-3-4 15:35

blob.png

获取控件名称为org的控件

blob.png

获取控件的值

blob.png

获取当前分类名称

sql那里是简单的拼接

blob.png

执行sql,获取返回值的第3列,第1行


  • 2关注人数
  • 507浏览人数
  • 最后回答于:2019-3-4 15:35
    请选择关闭问题的原因
    确定 取消
    返回顶部