MDX very slow looking for alternative syntax

Who is online?  0 guests and 1 members
Home  »  Forums   »  microsoft business intelligence   »  bi query languages (mdx, dmx)   » MDX very slow looking for alternative syntax

MDX very slow looking for alternative syntax

Topic RSS Feed

Posts under the topic: MDX very slow looking for alternative syntax

Posted: 2/23/2010

Jedi Youngling 4  points  Jedi Youngling
  • Joined on: 2/23/2010
  • Posts: 2

Below is an example of MDX syntax used on our DTS, but I observed that it takes ages to complete, I want alternative way of doing it.

Any idea or can you link me up with a user group where I can post the challenge?

Note the name 'Loss Sales Stock' is the name of this syntax(measure) itself  defined in the analysis manger; while the other measures are QoH and arws. the dimesions is products 

 

 -- restrict this calculation to LEAF (lowest level) items - ie sku

 

 

 

iif

 

( isleaf([products].currentmember),

 

 

-- show only items with qoh less than arws

 

 

iif([QoH]-[arws]<0,([QoH]-[arws]),null),

-- for non-leaf items, sum the results of the previous calculation

sum

 

([products].currentmember.children ,[Loss Sales Stock]) )

 


Posted: 2/27/2010

Jedi Master 3999  points  Jedi Master
  • Joined on: 10/28/2009
  • Posts: 25

Using a SCOPE assignment instead of double IIF's should speed this up. Give that a shot.


Posted: 2/28/2010

Padawan 1213  points  Padawan
  • Joined on: 1/3/2010
  • Posts: 208

Try Adam sugestion.

Btw, are you running in a 32 bit server? I've had an performance issue in one cube because of the detailed needed. My solution was to calculate that in my fact table and just add the measure into the cube.

But now, with a 64 bit server, I have done a lot of measures with IIF and scope and ain't no performance issue...yet. It's a huge difference.


Posted: 3/1/2010

Jedi Youngling 4  points  Jedi Youngling
  • Joined on: 2/23/2010
  • Posts: 2

Thanks Adam,

I will appreciate your input in getting the equivatent syntax using 'scope' for I have tried but no success.

 

Thanks.

 

Patrick

 

 

 


Posted: 3/11/2010

Padawan 139  points  Padawan
  • Joined on: 12/21/2009
  • Posts: 18

Hi Patrick,

Not sure of the specifics of your user-defined Products hierarchy but you might be able to do something like this in your cube's MDX script.

CREATE MEMBER CurrentCube.[Measures].[Level Specific Calculated Member] AS NULL;


//Overwrite SKU level
SCOPE([Measures].[Level Specific Calculated Member]
 , Descendants ([Product Dim].[Product Hierarchy]
   ,[Product Dim].[Product Hierarchy].[SKU]
   ,SELF)
);

  this = iif([Measures].[QoH]-[Measures].[arws]<0,([Measures].[QoH]-[Measures].[arws]),NULL);

END SCOPE;

//Overwrite all levels above SKU
SCOPE([Measures].[Level Specific Calculated Member]
 , Descendants ([Product Dim].[Product Hierarchy]
   ,[Product Dim].[Product Hierarchy].[SKU]
   ,BEFORE)
);

  this = sum([Product Dim].[Product Hierarchy].currentmember.children ,[Measures].[Loss Sales Stock]) ;

END SCOPE;

Hope this help.  Sorry for the delayed response.  I don't check this forum enough.

Regards,

Luke


Page 1 of 1 (5 items)