找文章 / 找答案
精选问答 更多内容

[数据处理] 交叉表计算列

johnsz青铜一 显示全部楼层 发表于 9 小时前 |阅读模式 打印 上一主题 下一主题
1
未解决

【数据处理】 交叉表计算列

  • johnsz青铜一
  • 2024-12-18 09:21:47
  • 发布在 产品问答
112 10
一个交叉表,有5列,从左到右:城市,产品类型,用户类型,营销收入,营销支出,也加入了基于城市的行小计。
问题是:如何在营销收入和营销支出列后面加入一个营销收支率=营销收入/营销支出?
用计算列sum(col1)/sum(col2)的方式处理不了;
请问如何解决?


回复

使用道具 举报

精彩评论10

yhdata_lyaa 显示全部楼层 发表于 8 小时前
一个交叉表,有5列,全部绑定到列表头了吗,可以截图看看是怎么绑定的吗。
计算列sum(col1)/sum(col2)的方式处理不了;是有啥问题

回复

使用道具 举报

johnsz青铜一 显示全部楼层 发表于 8 小时前
你好,由于信息安全,无法截图;
提问是模拟的字段,绑定情况是:

城市,产品类型,用户类型按照从上往下绑定行表头,营销收入,营销支出字段是汇总
回复

使用道具 举报

yhdata_lyaa 显示全部楼层 发表于 8 小时前
类似这样吗,计算有什么不对吗
回复

使用道具 举报

johnsz青铜一 显示全部楼层 发表于 7 小时前
是的,你的计算列公式请分享一下,我测试一下
回复

使用道具 举报

yhdata_lyaa 显示全部楼层 发表于 7 小时前
是一样的

回复

使用道具 举报

johnsz青铜一 显示全部楼层 发表于 6 小时前
本帖最后由 johnsz 于 2024-12-18 11:43 编辑

我的操作和你的一样,但是错误提示如下
回复

使用道具 举报

johnsz青铜一 显示全部楼层 发表于 6 小时前
错误代码:130000031

DBUnsupportFuncException: “PostgreSQL”不支持“TOTALOP_1”函数,或者参数个数错误。
        at g5.common.qry.sql.SQLTool.getSQL(SQLTool.java:122)
        at g5.meta.exp.UnaryOp.getSQL(UnaryOp.java:210)
        at g5.meta.exp.ExpHelper.getVal(ExpHelper.java:88)
        at g5.meta.exp.fun2.Divide.getSQL(Divide.java:60)
        at g5.meta.UserCol.getSQL(UserCol.java:303)
        at g5.gqry.SelectBuilder.col2SQL(SelectBuilder.java:77)
        at g5.gqry.SelectBuilder.build(SelectBuilder.java:52)
        at g5.gqry.SQLBuilder.build(SQLBuilder.java:253)
        at g5.gqry.SQLBuilder.build(SQLBuilder.java:321)
        at g5.gqry.SQLGQuery.push(SQLGQuery.java:210)
        at g5.gqry.GQuery.<init>(GQuery.java:1062)
        at g5.gqry.SQLGQuery.<init>(SQLGQuery.java:128)
        at g5.gqry.GQuery.create(GQuery.java:375)
        at g5.gqry.GQuery.create(GQuery.java:233)
        at g5.sv.qry.req.PreviewQryReq.process0(PreviewQryReq.java:242)
        at g5.sv.Req.process(Req.java:57)
        at g5.sv.qry.impl.QueryServiceImpl.process(QueryServiceImpl.java:244)
        at g5.sv.qry.QueryProc.procReq(QueryProc.java:163)
        at g5.sv.qry.QueryProc.service(QueryProc.java:64)
        at g5.sv.ServletHelper.service(ServletHelper.java:134)
        at g5.sv.PortalServlet.service(PortalServlet.java:1574)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at com.yonghongtech.filter.OfflineFilter.doFilter(OfflineFilter.java:56)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at com.yonghongtech.filter.SSOFilter.doFilter0(SSOFilter.java:93)
        at com.yonghong.api.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:59)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at com.zte.uac.ssoclient.UACSsoStatusFilter.doFilter(UACSsoStatusFilter.java:254)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
        at java.base/java.lang.Thread.run(Thread.java:829)
回复

使用道具 举报

yhdata_lyaa 显示全部楼层 发表于 5 小时前
“PostgreSQL”不支持“TOTALOP_1”函数,试试数据集取消 勾选数据库内计算呢
回复

使用道具 举报

johnsz青铜一 显示全部楼层 发表于 4 小时前
取消后,提示如下:错误代码:110099999

g5.util.RTWrappedException: java.lang.Exception: 数据集:**-->[列:计算列 ,行:2]-->不支持被调用的方法。
        at g5.grid.impl.QFormulaGrid.exists0(QFormulaGrid.java:179)
        at g5.grid.impl.AbsExecutingGrid.exists(AbsExecutingGrid.java:25)
        at g5.common.grid.PlainMeta.<init>(PlainMeta.java:61)
        at g5.common.grid.PlainMeta.<init>(PlainMeta.java:52)
        at g5.grid.impl.QFormulaGrid.getMeta(QFormulaGrid.java:76)
        at g5.grid.FilterGrid.getMeta(FilterGrid.java:98)
        at g5.grid.DefWrapGrid.createMeta(DefWrapGrid.java:250)
        at g5.grid.DefWrapGrid.getMeta(DefWrapGrid.java:132)
        at g5.grid.ColumnGrid.getMeta(ColumnGrid.java:94)
        at g5.grid.DefWrapGrid.createMeta(DefWrapGrid.java:250)
        at g5.grid.DefWrapGrid.getMeta(DefWrapGrid.java:132)
        at g5.sv.qry.req.PreviewQryReq.process0(PreviewQryReq.java:263)
        at g5.sv.Req.process(Req.java:57)
        at g5.sv.qry.impl.QueryServiceImpl.process(QueryServiceImpl.java:244)
        at g5.sv.qry.QueryProc.procReq(QueryProc.java:163)
        at g5.sv.qry.QueryProc.service(QueryProc.java:64)
        at g5.sv.ServletHelper.service(ServletHelper.java:134)
        at g5.sv.PortalServlet.service(PortalServlet.java:1574)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at com.yonghongtech.filter.OfflineFilter.doFilter(OfflineFilter.java:56)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at com.yonghongtech.filter.SSOFilter.doFilter0(SSOFilter.java:93)
        at com.yonghong.api.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:59)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at com.zte.uac.ssoclient.UACSsoStatusFilter.doFilter(UACSsoStatusFilter.java:254)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.Exception: 。
        at g5.grid.impl.FormulaColumn.nextBlock(FormulaColumn.java:223)
        at g5.grid.impl.FormulaColumn.execute(FormulaColumn.java:79)
        at g5.grid.impl.QFormulaGrid.execute(QFormulaGrid.java:166)
        at g5.grid.impl.EGridExecutor.execute(EGridExecutor.java:33)
        at g5.grid.impl.AbsGridPool$GridRunnable.run(AbsGridPool.java:169)
        at g5.thread.ThreadPoolWithChecker$GThread.run0(ThreadPoolWithChecker.java:251)
        at g5.thread.AbsThreadPool$PThread.run(AbsThreadPool.java:336)
回复

使用道具 举报

高级模式
您需要登录后才可以回帖 登录 | 免费注册

  • 官方微信

    欢迎关注永洪服务号!收费为0,价值无限

    扫码关注
  • 新浪微博

    让每位用户轻松挖掘数据价值!

    访问新浪微博
  • 智能客服
50W

会员等你来哦

Copyright   ©2012-2024  北京永洪商智科技有限公司  (京ICP备12050607) 京公网安备110110802011451号 |《永洪社区协议》
返回顶部