dbTalk Databases Forums  

Hiding/Removing 0 from Time Dimension

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


Discuss Hiding/Removing 0 from Time Dimension in the microsoft.public.sqlserver.olap forum.



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

Default Hiding/Removing 0 from Time Dimension - 02-19-2004 , 04:46 AM






Hi All
In my time dimension(Year,Quarter,Month) field, due to some of the date values are null i am getting year values like 0,2001,2002.How to remove this 0 from my year values?

Thanks
Vasu

Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default RE: Hiding/Removing 0 from Time Dimension - 02-19-2004 , 06:31 AM






If are you deriving your Time dimension from a fact table field, you should build it from a separate dimension table
This way fact table records with null dates will not be included

For a complete discussion on building time dimensions see Tom Chester's excellent article

http://www.sqljunkies.com/Article/D1...0D60951395.scu

HTH
Bria
www.geocities.com/brianaltmann/olap.htm


Reply With Quote
  #3  
Old   
vasu
 
Posts: n/a

Default Re: Hiding/Removing 0 from Time Dimension - 02-19-2004 , 06:52 AM



Hi Brain Altmann

I using Views instead of Fact and dimesnion Tables. For views how
can i hide the 0 year and in that replace with string 'N/A' .

Thanks,
Vasu

"Brian Altmann" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
If are you deriving your Time dimension from a fact table field, you
should build it from a separate dimension table.
This way fact table records with null dates will not be included.

For a complete discussion on building time dimensions see Tom Chester's
excellent article:


http://www.sqljunkies.com/Article/D1...D60951395.scuk

HTH,
Brian
www.geocities.com/brianaltmann/olap.html




Reply With Quote
  #4  
Old   
Brian Altmann
 
Posts: n/a

Default Re: Hiding/Removing 0 from Time Dimension - 02-19-2004 , 08:51 AM



You could use a sql case statement in the member name column property
However it would really be best to create a time dimension table (or view)

HTH
Brian

Reply With Quote
  #5  
Old   
Greg Walker
 
Posts: n/a

Default Re: Hiding/Removing 0 from Time Dimension - 02-20-2004 , 12:54 PM



If you don't need them at all, just filter them out in the SQL (e.g. "where
year <> 0 ..."). If you *DO* need the members in the dimension (for
instance, I've built cubes where facts may be associated with months,
quarters, &/OR years) then base the dimension on a view rather than the root
table. Use SQL like:
SELECT Case WHEN [YEAR] = 0 then 'N/A' else cast([YEAR] as varchar) end
as MemberName
FROM ....

Assuming your table has a "YEAR" column. Alternately, you could return an
empty string (instead of N/A) for the "unwanted" members and set the
dimension to "hide members with no name".

GW


"Brian Altmann" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
You could use a sql case statement in the member name column property.
However it would really be best to create a time dimension table (or
view).

HTH,
Brian



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.