dbTalk Databases Forums  

Pre-populated time dimension

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


Discuss Pre-populated time dimension in the microsoft.public.sqlserver.olap forum.



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

Default Pre-populated time dimension - 11-01-2003 , 01:15 AM






Read a thread where a Tom Chester sugested, mainly for performance reasons,
using pre-populated time dim.

If yo do this, is there a way to show only the times up to a specific time
- such as "now"? e.g. On October 31 I don't want November and December to
show in the time dim yet.

Also, is there a function in MDX to retrieve the current system time. I
tried Now and GetDate but ...

Les McPhee

Reply With Quote
  #2  
Old   
Ray Higdon
 
Posts: n/a

Default Re: Pre-populated time dimension - 11-01-2003 , 08:35 PM






When you prepopulate a time dimension, the only way you will see a future
date with a query is if your fact table has a value that links to a future
date.

--
Ray Higdon MCSE, MCDBA, CCNA
---
"Les McPhee" <lmcphee69 (AT) hotmail (DOT) com> wrote

Quote:
Read a thread where a Tom Chester sugested, mainly for performance
reasons,
using pre-populated time dim.

If yo do this, is there a way to show only the times up to a specific time
- such as "now"? e.g. On October 31 I don't want November and December to
show in the time dim yet.

Also, is there a function in MDX to retrieve the current system time. I
tried Now and GetDate but ...

Les McPhee



Reply With Quote
  #3  
Old   
Dave McChristie
 
Posts: n/a

Default Re: Pre-populated time dimension - 11-05-2003 , 10:53 AM



This has not been my experience. This is true with cub files, but not with
cubes. The only way to ensure that future times do not show up is to run a
SQL query to delete unused time dimensions. Note: If you are using the
non-empty function unsed ones will not show up but they are still in the
cube. This is important if you are using closingperiod to determine a YTD
to date total. An example I have is an inventory cube. I always want the
measure closing inventory to display my current inventory if I have picked
the current year or period. If the time dimension is fully populated and I
pick the current year, closing period will choose december and my closing
measure will be 0. If I remove unused dimension members from time then my
closing period will be November and closing will reflect its current value.

I do this by storing a temp time table off to the side. This table contains
all of the dates I will ever need for time. Each night during the data load
I truncate my time table, copy my temp table over, and delete the unused
members. This seems to work fine.

Dave McChristie


"Ray Higdon" <rayhigdon (AT) higdonconsulting (DOT) com> wrote

Quote:
When you prepopulate a time dimension, the only way you will see a future
date with a query is if your fact table has a value that links to a future
date.

--
Ray Higdon MCSE, MCDBA, CCNA
---
"Les McPhee" <lmcphee69 (AT) hotmail (DOT) com> wrote in message
news:Xns9426CE6FFDA7lesliermcpheehoneywe (AT) 207 (DOT) 46.248.16...
Read a thread where a Tom Chester sugested, mainly for performance
reasons,
using pre-populated time dim.

If yo do this, is there a way to show only the times up to a specific
time
- such as "now"? e.g. On October 31 I don't want November and December
to
show in the time dim yet.

Also, is there a function in MDX to retrieve the current system time. I
tried Now and GetDate but ...

Les McPhee





Reply With Quote
  #4  
Old   
Coen
 
Posts: n/a

Default Re: Pre-populated time dimension - 11-13-2003 , 03:40 PM



Les McPhee wrote:

Quote:
Read a thread where a Tom Chester sugested, mainly for performance reasons,
using pre-populated time dim.

If yo do this, is there a way to show only the times up to a specific time
- such as "now"? e.g. On October 31 I don't want November and December to
show in the time dim yet.
To solve this problem in an earlier project, I created a view on the
Time dimension table in the relational database that selected all
records from the time dimension where the time key was in a list of
distinct time keys from the fact table. I used that view to feed the
time dimension in AS. This might be a burden on the RDBMS, but you could
find a way around it with some ETL ore something. The point is that this
way your time dimension is completely data driven.

Quote:
Also, is there a function in MDX to retrieve the current system time. I
tried Now and GetDate but ...
AS supports a large number of VBA functions. To get todays date and time
you can use syntax like:

VBA!Now()

This will return the current date and time like a string. If you want
the date like yyyymmdd because your days in the time dimension have
names like that, use:

VBA!Format(VBA!Now(), "yyyymmdd")

in combination with StrToMember() and Ancestor() you can find the
current week, month etc.

Search for this syntax in google groups and you'll find all you need.

Cheers,

Coen



Reply With Quote
  #5  
Old   
dpuri
 
Posts: n/a

Default Re: Pre-populated time dimension - 11-13-2003 , 09:53 PM



I am using a SQL view on the date table that only returns dates upto
yesterday. In SQL Server, the filter for a 12-month + current month
window (upto yesterday) looks like:

Quote:
where date_key between
DateAdd(mm,-12,
DateAdd(dd,1-DatePart(dd,dbo.PrevDay(getdate())),
dbo.PrevDay(getdate())))
and dbo.PrevDay(getdate())
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.