mdx - Creating a measure by filtering out a set from an existing measure -


i trying implement follows:

with member measures.test2  sum (   {     [date].[calendar].[calendar year].&[2006]    ,[date].[calendar].[calendar year].&[2007]   }  ,[measures].[internet sales amount] )  select measures.test2 on columns  [adventure works]; 

but want new measure test2 sliceable according calendar year dimension. want like

select {measures.test2} on 0, {[date].[calendar].[calendar year].[calendar year].members} on 1  [adventure works]; 

this giving same value both years 2006 , 2007.

in essence want create member taking subset of existing measure , using further calculations

this script not valid mdx:

select (measures.test2,[date].[calendar].[calendar year].[calendar year] on columns  [adventure works]; 

you have single ( before measures.
you're add tuple on columns not allowed. sets allowed on rows , columns:

select  {measures.test2} on 0, {[date].[calendar].[calendar year].[calendar year].members} on 1 [adventure works]; 

try following:

with    member measures.test2      sum     (       intersect       (         {[date].[calendar].currentmember}        ,{           [date].[calendar].[calendar year].&[2006]          ,[date].[calendar].[calendar year].&[2007]         }       )      ,[measures].[internet sales amount]     )  select    [measures].test2 on columns  ,{[date].[calendar].[calendar year].members} on rows [adventure works]; 

the above returns this:

enter image description here

or maybe want subselect:

select    [measures].[internet sales amount] on columns  ,{[date].[calendar].[calendar year].members} on rows  (   select      {       [date].[calendar].[calendar year].&[2006]      ,[date].[calendar].[calendar year].&[2007]     } on 0   [adventure works] ); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -