reporting-services - How to write SSRS 2017 expression for calculating percentages when report contains Row Groups level hierarchy data
问题描述
I'm trying to show monthly data for products. A month can have any number of products from A to Z depends on availability of products for that month. For example, January 2020 has products A, B, and C. Total is sum(amount) for these products.
I have taken Column Groups hierarchy as MonthYear and Product; Row Groups hierarchy as City, State, Region, and Country.
I'm able to show Total column at State, Region,and Country level by adding up at group level.
But I'm facing difficulty in showing Product% column figures especially at State, Region,and Country level.
For Product%, I'm trying to write something like sum(amount)/[sum(amount) for ALL Products].
Could you please help me in writing SSRS expression for achieving Product% figures at State, Region,and Country level.
解决方案
Assuming you have a row group called 'groupCity' then this should work.
=SUM(Fieldsamount.Value) / SUM(Fields!amount.Value, "groupCity")
You will need to change the expression to match the rowgroup
name for each additional instance that you need it (so probably state, region and country)
推荐阅读
- mysql - 为什么我在尝试更改密码时在 cmd 中收到 MySQL 错误?
- java - 如果其元素等于最大元素,如何删除整个节点
- java - Java:获取嵌套xml文件中子节点值的总和
- node.js - 运行“npm install”失败
- java - 我可以写位于类路径的文件吗
- python - mypy 类型问题 - 可能的重载变体
- css - React Native 角样式 FlatList 组件
- postgresql - 当我恢复我的数据时,我使用 pg_restore 但它给了我错误我尝试了所有解决方案
- priority-web-sdk - webSdk 过程的参数顺序
- playframework - 如何将 Source[String, Future[IOResult]] 转换为 Source[ByteString, Future[IOResult]]