我有一个像这样的报告, 它有嵌套组,外部组在业务伙伴上,内部组在货币代码上。
Busines Partner1
Opening Balance for USD as of 2013-10-01
Transaction 1..
Transaction n..
USD Totals
Balance for EUR as of 2013-10-01
Transaction 1..
Transaction n..
EUR Totals
Busines Partner2
Opening Balance for USD as of 2013-10-01
Transaction 1..
Transaction n..
USD Totals
Balance for EUR as of 2013-10-01
Transaction 1..
Transaction n..
EUR Totals
我需要的是业务合作伙伴组页脚,我想显示每种货币代码的总体未结余额。喜欢的东西;
Busines Partner1
Opening Balance for USD as of 2013-10-01
Transaction 1..
Transaction n..
USD Totals
Balance for EUR as of 2013-10-01
Transaction 1..
Transaction n..
EUR Totals
(Assume below section is Business Partner1 Group Footer)
Currency, Opening Balance, Sum of In Period, Overall
USD 200.00 300.00 500
EUR 150.00 400.00 550
Total 1050
Busines Partner2
Opening Balance for USD as of 2013-10-01
Transaction 1..
Transaction n..
USD Totals
Balance for EUR as of 2013-10-01
Transaction 1..
Transaction n..
EUR Totals
(Assume below section is Business Partner2 Group Footer)
Currency, Opening Balance, Sum of In Period, Overall
USD 100.00 300.00 400
EUR 250.00 300.00 550
Total 950
问题是我如何实现这个目标?
答案 0 :(得分:1)
我认为你必须正确地组织你的团体..
基于以下示例数据:
SELECT 'BusinessPartner1' BusinessPartner, 'EUR' CurrencyType, 100 Amount, 122 TotalSpend UNION
SELECT 'BusinessPartner1' BusinessPartner, 'GBP' CurrencyType, 111 Amount, 301 TotalSpend UNION
SELECT 'BusinessPartner2' BusinessPartner, 'EUR' CurrencyType, 81 Amount, 191 TotalSpend UNION
SELECT 'BusinessPartner2' BusinessPartner, 'GBP' CurrencyType, 13 Amount, 93 TotalSpend UNION
SELECT 'BusinessPartner2' BusinessPartner, 'USD' CurrencyType, 30 Amount, 32 TotalSpend UNION
SELECT 'BusinessPartner3' BusinessPartner, 'GBP' CurrencyType, 78 Amount, 42 TotalSpend UNION
SELECT 'BusinessPartner3' BusinessPartner, 'USD' CurrencyType, 210 Amount, 61 TotalSpend UNION
SELECT 'BusinessPartner3' BusinessPartner, 'EUR' CurrencyType, 12 Amount, 71 TotalSpend
如果您按照这样的方式构建您的群组(1个父亲,1个孩子,1个与孩子相邻):
然后你得到以下输出,我认为这是你所追求的那种东西。为了得到您需要的内容,我认为您还需要在每个相邻组中使用详细信息子组