Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能直接对 数据集中的字段求和吗? #20

Closed
wyubaoyuan opened this issue Aug 9, 2017 · 11 comments
Closed

能直接对 数据集中的字段求和吗? #20

wyubaoyuan opened this issue Aug 9, 2017 · 11 comments

Comments

@wyubaoyuan
Copy link

No description provided.

@youseries
Copy link
Owner

@wyubaoyuan
Copy link
Author

sum(xly_statistics_stock.select(QTY))这样不行

@wyubaoyuan
Copy link
Author

数值一直是0,但明明这个字段不为0

@youseries
Copy link
Owner

正确的写法是:xly_statistics_stock.sum(QTY)

@youseries
Copy link
Owner

最新的2.0.8-SNAPSHOT也支持sum(xly_statistics_stock.select(QTY))这样的写法,请测试。

@wyubaoyuan
Copy link
Author

v_warerecord.sum(gradesA*QTY)这样报错

@youseries
Copy link
Owner

v_warerecord.sum(gradesA*QTY) 这是什么意思?两个属性相乘?ureport2可不支持这种写法,如果是,那正解的写法应该是:
v_warerecord.sum(gradesA) * v_warerecord.sum(QTY)
还是先好好了解下ureport2表达式语法,不能乱来!

@wyubaoyuan
Copy link
Author

v_warerecord.sum(gradesA) * v_warerecord.sum(QTY)这样达不到我的需求,我需要每条记录里的gradesA、QTY这两个字段相乘,再求和

@youseries
Copy link
Owner

嗯,UReport2不支持这么做。
不过你可以在SQL里把这两个属性相乘,以别名形式输出,再在报表里对这个别名求和。

@wyubaoyuan
Copy link
Author

嗯,已经这样处理了

@xsl9527-didi
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants