Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
thisisboni
Starting Member
6 Posts |
Posted - 2012-07-25 : 08:49:30
|
ABC is a Wholeseller and PQR is retail - the requirement is to report sales of PQR and the amount invoiced by ABC to PQR (This is done by reporting ABC's sales to PQR)Dimension - Company StructureCName Clocation-------------------ABC PQRPQR How do I include the invoiced amount (ABC's Sales to PQR) in the Query below ? select {[Measures].[Amount Sold]} on 0,([Date].[Quarter].children,[Date].[Month].children) on 1FROM ( SELECT ( STRTOSET("PQR", CONSTRAINED) ) ON COLUMNSfrom [SampleDW]) |
|
thisisboni
Starting Member
6 Posts |
Posted - 2012-07-26 : 10:59:16
|
ok! so got this to work with the query below - how do I use a parameter to this for ''PQR'with member [Measures].[Inv] as ( SUM([CompStruct].[CName].&[ABC]*STRTOSEt('[CompStruct].[Clocation].&[PQR]') ,[Measures].[Amount Sold]) )select {[Measures].[Amount Sold],[Measures].[Inv] } on 0,([Date].[Quarter].children,[Date].[Month].children) on 1FROM ( SELECT ( STRTOSET("PQR", CONSTRAINED) ) ON COLUMNSfrom [SampleDW])The query below returns NULL in the [INV]with member [Measures].[Inv] as ( SUM([CompStruct].[CName].&[ABC]*STRTOSEt("[CompStruct].[Clocation].&["+@param+"]") ,[Measures].[Amount Sold]) )select {[Measures].[Amount Sold],[Measures].[Inv] } on 0,([Date].[Quarter].children,[Date].[Month].children) on 1FROM ( SELECT ( STRTOSET(@param, CONSTRAINED) ) ON COLUMNSfrom [SampleDW]) |
|
|
|
|
|
|
|