最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reporting services - Aggregated sub-total within column - Stack Overflow

programmeradmin0浏览0评论

I have a detail TABLE, that I'd like to generate a sub-total for each value in a column. I have a data table that records a number (key). I have a reference table that has key/value pairs. On occasion, we add values to the reference table, and the value becomes available to the db detail table.

At each sub-grouping, I'd like to list the values, and their counts for the group. But I don't want to hard code these values. I don't want to have to make changes to the report. If we get new reference values, or the wording for an existing reference value changes, the report should be dynamic enough to pick up the changes.

Currently, I'm having to hard code the reference values:

=sum(IIF(Fields!meal.Value = "1", 1, 0)).ToString & chr(10) & chr(13) &
 sum(IIF(Fields!meal.Value = "2", 1, 0)).ToString & chr(10) & chr(13) &
 sum(IIF(Fields!meal.Value = "3", 1, 0)).ToString & chr(10) & chr(13) &
 sum(IIF(Fields!meal.Value = "4", 1, 0)).ToString & chr(10) & chr(13) &
 sum(IIF(Fields!meal.Value = "5", 1, 0)).ToString & chr(10) & chr(13) &
 sum(IIF(Fields!meal.Value = "6", 1, 0)).ToString & chr(10) & chr(13)

How can I make this dynamic enough I don't have to touch it again? If I can get the above working, I can use the same logic to do a look up on the key to populate the column in green next to the counts.

发布评论

评论列表(0)

  1. 暂无评论