dbTalk Databases Forums  

RE: MDX - looking for member that is sometimes there

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss RE: MDX - looking for member that is sometimes there in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrea Worley
 
Posts: n/a

Default RE: MDX - looking for member that is sometimes there - 06-02-2004 , 10:56 AM






Thanks Chris. I couldn't get the ISERROR to work the way I wanted, but I did take your advice and I changed my dimension to come off a pre-existing table that contained all values. Thanks


----- Chris Webb wrote: ----

Hi Andrea

First of all, to avoid your question, you shouldn't have a scenario where a dimension can sometimes contain a member and sometimes not. Similar to the way you should build a time dimension from a pre-existing table containing all possible dates rather than the ones in your fact table, you should probably build your own Gender dimension table containing M, F and U so you never encounter this problem

That said, if you want to write MDX that handles missing members, you can use the ISERROR and STRTOSET functions. Take a look at the following thread to see how
http://groups.google.co.uk/groups?hl....sqlserver.ola

HTH

Chri


----- Andrea Worley wrote: ----

I am trying to get values for a dimension member that is sometimes in the data and sometimes not

If I wanted to show Unit Sales for gender Female, I would run
select {[measures].[Unit Sales]} on columns, {[Gender].[F]} on rows from Sale

But assuming that sometimes the data contained gender = U for unknown, if I wanted to show Unit Sales for gender unknown, I would run

select {[measures].[Unit Sales]} on columns, {[Gender].[u]} on rows from Sale

If that day the cube contained no data for Gender type unknown, I get the error: Unable to open cellset. Formula error - cannot find dimension member ("[Gender].[u]") in a name binding function

Is there anyway to structure the MDX so that it doesn't throw an error in this case, it just shows as blank

Thank you.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.