如何在水晶报表中按组查找百分比?
我正在使用 Visual Studio 中的 Crystal Reports 插件来开发 Crystal Reports。
在我的报告中,有三个分组功能。层次结构如下所示 -
Employee.EmployeeType
Employee.EmployeeCity
Employee.OfficeBranch
我需要计算每个城市每个分支机构所占用的席位百分比。条件是只应考虑座位号大于 5 的座位。
我正在使用以下公式,但它给我错误说 )预期
-
@seatNumber
if({Employee.SeatNumber},{Employee.OfficeBranch})>5
then
count({Employee.SeatNumber})
else
0
我知道我们必须使用 if ({key field}, {Group field})
然后我们必须创建另一个公式,用于 sum(@seatNumber)
。
然后必须使用两者来计算每组的百分比。但我被困住了。
I am using crystal reports plugin in visual studio to develop crystal reports.
In my report, there are three group by functions. The hierarchy is shows below -
Employee.EmployeeType
Employee.EmployeeCity
Employee.OfficeBranch
I need to calculate percentage of Seats occupied in every branch per city. The condition is that only those seats should be considered that have seatnumber greater than 5.
I am using the following formula but it is giving me error saying ) expected
-
@seatNumber
if({Employee.SeatNumber},{Employee.OfficeBranch})>5
then
count({Employee.SeatNumber})
else
0
I know we have to use if ({key field}, {Group field})
and then we have to create another formula which we will use to sum(@seatNumber)
.
and then will have to use both to calculate percentage per group. But I am stuck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
if({Employee.SeatNumber},{Employee.OfficeBranch})>5
不是有效的表达式。
你的意思可能是这样的:
如果 {Employee.SeatNumber} > 5
if({Employee.SeatNumber},{Employee.OfficeBranch})>5
is not a valid expression.
You probably meant something like:
if {Employee.SeatNumber} > 5
由于您希望忽略 1 到 5 号席位,因此只需将此条件添加到记录选择公式中就会简单得多:
Since you wish to ignore seats 1-to-5 it would be a lot simpler to just add this condition to the record selection formula: