0

enter image description here私はYTDをどのように計算するのかに関するいくつかの提案が必要です。私は、私はその見つけるために使用して式をも言及している私は私のレポートで計算したいYTD値は Totals in Matrix in SSRSYTD in SSRS Matrix

をtab.-合計を計算する前に、質問は、私が投稿の質問の続きです.This黄色で強調していますそれらの値。 enter image description here

+0

私はまだあなたが探しているまさにワークアウトが、それらは括弧(H13 - G13)必要があるように、それはあなたのYTD式を言及する価値が見えると思っています/ G13を..私は%変化を探していると思います。今書いているとおり、(H13-G13/G13)あなたはH13-1になります。 – Jesse

+0

はい、その割合です。それを修正していただきありがとうございます。 – Papil

+0

お願いします。 – Papil

答えて

0

私はSQLでこれをやっていると思います。ここで私はそれを行うだろうかの例の下にあります:

declare @tbl table 
(
    Country varchar(2), 
    Type varchar(1), 
    Names varchar(5), 
    Qty int, 
    DateValue datetime 
) 

insert into @tbl 
values ('US', 'A','BB-1',10,'12/01/2015'), 
     ('US', 'A','BB-2',20,'12/01/2015'), 
     ('IN', 'A','BB-1',0,'12/01/2015'), 
     ('IN', 'A','BB-2',10,'12/01/2015'), 
     ('US', 'A','BB-1',30,'12/01/2016'), 
     ('US', 'A','BB-2',40,'12/01/2016'), 
     ('IN', 'A','BB-1',50,'12/01/2016'), 
     ('IN', 'A','BB-2',70,'12/01/2016') 

select 
    t.*, 
    YearEnd.YearEnd , 
    case when YearEnd.YearEnd = 0 then null else (t.Qty - YearEnd.YearEnd)/convert(decimal(36,4),YearEnd.YearEnd) end as YearEndCalc 
from @tbl as t 
left join 
(
    select 
     year(DateValue) as YearValue, 
     Type, 
     sum(Qty) as YearEnd 
    from @tbl 
    where 
     month(DateValue) = 12 
    group by 
     year(DateValue) , 
     Type 
) as YearEnd 
on YearEnd.YearValue = year(t.datevalue)-1 
and YearEnd.Type = t.Type