1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| select
max([Analysis View Code]) as Vue,
max([G_L Account No_]) as Cpte_Gle,
[Dimension 2 Value Code] as Nature,
max(T1.[Name]) as Designation,
sum (cast([Amount]as float)) as Montant_Global,
sum(case [Dimension 1 Value Code] when 'AB' then cast([Amount]as float) else 0 end ) as REGION_01,
sum(case [Dimension 1 Value Code] when 'AMA' then cast([Amount]as float) else 0 end ) as REGION_02,
sum(case [Dimension 1 Value Code] when 'SODR' then cast([Amount]as float) else 0 end ) as REGION_03
from dbo.[SOCIETE$Analysis View Entry]
right outer join dbo.[SOCIETE$Dimension Value] T1
on [Dimension 2 Value Code] = T1.Code
where [Analysis View Code] = 'COMMANDES'
and [Posting Date] between '01/09/2010' and '30/09/2010'
and [Dimension Code] = 'NATURE'
Group by [Dimension 2 Value Code]
order by [Dimension 2 Value Code] |
Partager