dbTalk Databases Forums  

Current Time

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


Discuss Current Time in the microsoft.public.sqlserver.olap forum.



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

Default Current Time - 10-18-2004 , 01:43 PM






Hi,

I have a cube with my sales data. I'd like user to have the posibility to
use a "Today Sales", a "This Week Sales". How can I do this?
I thought of somehow using a dimension member property but I don't know how.
My source for the time dimension is a relational table that has 3 extra
columns name Current Date, Current Week and Current Month all of them are
datetime columns populated on the specific rows Like the CurretDate field is
always populated on a single record that shows wich day is today and so on.
Can I use this?

Thanks


Reply With Quote
  #2  
Old   
HWUK
 
Posts: n/a

Default RE: Current Time - 10-19-2004 , 07:05 AM






Try this code as the default member in the time dim.

Tail(Filter([Time].[Month].Members, NOT
IsEmpty(Time.CurrentMember)),1).Item(0)

Is this the kind of thing your looking for?

"Miguel Salles" wrote:

Quote:
Hi,

I have a cube with my sales data. I'd like user to have the posibility to
use a "Today Sales", a "This Week Sales". How can I do this?
I thought of somehow using a dimension member property but I don't know how.
My source for the time dimension is a relational table that has 3 extra
columns name Current Date, Current Week and Current Month all of them are
datetime columns populated on the specific rows Like the CurretDate field is
always populated on a single record that shows wich day is today and so on.
Can I use this?

Thanks


Reply With Quote
  #3  
Old   
Miguel Salles
 
Posts: n/a

Default RE: Current Time - 10-19-2004 , 12:17 PM



Almost there!

My cube is populated with future data (like something that we will sell
tomorrow) so the default member is now on september 2005 (last registered
sale)!!! This is why I wanted to use a member property on this matter, can
you help me?

Thanks a lot


"HWUK" wrote:

Quote:
Try this code as the default member in the time dim.

Tail(Filter([Time].[Month].Members, NOT
IsEmpty(Time.CurrentMember)),1).Item(0)

Is this the kind of thing your looking for?

"Miguel Salles" wrote:

Hi,

I have a cube with my sales data. I'd like user to have the posibility to
use a "Today Sales", a "This Week Sales". How can I do this?
I thought of somehow using a dimension member property but I don't know how.
My source for the time dimension is a relational table that has 3 extra
columns name Current Date, Current Week and Current Month all of them are
datetime columns populated on the specific rows Like the CurretDate field is
always populated on a single record that shows wich day is today and so on.
Can I use this?

Thanks


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

Default RE: Current Time - 10-20-2004 , 07:39 AM



Try the following

StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") and click ok.

Now I know not all time dimensions are built the same way, in fact at one
place I had to use the following - StrToMember("[Month].[Year].&[" +
Format(Now(), "yyyy") + "].&["+ Format(Now(), "mmm") + "]")

So for October 2004 the resulting MDX value looked like this -

StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") =
[Time].[Month].[October]

StrToMember("[Month].[Year].&[" + Format(Now(), "yyyy") + "].&["+
Format(Now(), "mmm") + "]") = [Month].[Year].&[2004].&[10]

If the MDX doesn’t match your dimension it shouldn’t take long to figure the
syntax.

Hope this helps.

Howard.

Related forum
-http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=17&messageid=139979



"Miguel Salles" wrote:

Quote:
Almost there!

My cube is populated with future data (like something that we will sell
tomorrow) so the default member is now on september 2005 (last registered
sale)!!! This is why I wanted to use a member property on this matter, can
you help me?

Thanks a lot


"HWUK" wrote:

Try this code as the default member in the time dim.

Tail(Filter([Time].[Month].Members, NOT
IsEmpty(Time.CurrentMember)),1).Item(0)

Is this the kind of thing your looking for?

"Miguel Salles" wrote:

Hi,

I have a cube with my sales data. I'd like user to have the posibility to
use a "Today Sales", a "This Week Sales". How can I do this?
I thought of somehow using a dimension member property but I don't know how.
My source for the time dimension is a relational table that has 3 extra
columns name Current Date, Current Week and Current Month all of them are
datetime columns populated on the specific rows Like the CurretDate field is
always populated on a single record that shows wich day is today and so on.
Can I use this?

Thanks


Reply With Quote
  #5  
Old   
Miguel Salles
 
Posts: n/a

Default RE: Current Time - 10-20-2004 , 11:59 AM



It Works!!!

Thanks a lot, my syntax is a bit different however I got the Idea, so I can
now build my own default member!

Thanks again


"HWUK" wrote:

Quote:
Try the following

StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") and click ok.

Now I know not all time dimensions are built the same way, in fact at one
place I had to use the following - StrToMember("[Month].[Year].&[" +
Format(Now(), "yyyy") + "].&["+ Format(Now(), "mmm") + "]")

So for October 2004 the resulting MDX value looked like this -

StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") =
[Time].[Month].[October]

StrToMember("[Month].[Year].&[" + Format(Now(), "yyyy") + "].&["+
Format(Now(), "mmm") + "]") = [Month].[Year].&[2004].&[10]

If the MDX doesn’t match your dimension it shouldn’t take long to figure the
syntax.

Hope this helps.

Howard.

Related forum
-http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=17&messageid=139979



"Miguel Salles" wrote:

Almost there!

My cube is populated with future data (like something that we will sell
tomorrow) so the default member is now on september 2005 (last registered
sale)!!! This is why I wanted to use a member property on this matter, can
you help me?

Thanks a lot


"HWUK" wrote:

Try this code as the default member in the time dim.

Tail(Filter([Time].[Month].Members, NOT
IsEmpty(Time.CurrentMember)),1).Item(0)

Is this the kind of thing your looking for?

"Miguel Salles" wrote:

Hi,

I have a cube with my sales data. I'd like user to have the posibility to
use a "Today Sales", a "This Week Sales". How can I do this?
I thought of somehow using a dimension member property but I don't know how.
My source for the time dimension is a relational table that has 3 extra
columns name Current Date, Current Week and Current Month all of them are
datetime columns populated on the specific rows Like the CurretDate field is
always populated on a single record that shows wich day is today and so on.
Can I use this?

Thanks


Reply With Quote
  #6  
Old   
k_s
 
Posts: n/a

Default RE: Current Time - 06-02-2005 , 02:40 AM




Thanks from me too. Works well, and it has got the flexibility I neede.


"HWUK" wrote:

Quote:
Try the following

StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") and click ok.

Now I know not all time dimensions are built the same way, in fact at one
place I had to use the following - StrToMember("[Month].[Year].&[" +
Format(Now(), "yyyy") + "].&["+ Format(Now(), "mmm") + "]")

So for October 2004 the resulting MDX value looked like this -

StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") =
[Time].[Month].[October]

StrToMember("[Month].[Year].&[" + Format(Now(), "yyyy") + "].&["+
Format(Now(), "mmm") + "]") = [Month].[Year].&[2004].&[10]

If the MDX doesn’t match your dimension it shouldn’t take long to figure the
syntax.

Hope this helps.

Howard.

Related forum
-http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=17&messageid=139979



"Miguel Salles" wrote:

Almost there!

My cube is populated with future data (like something that we will sell
tomorrow) so the default member is now on september 2005 (last registered
sale)!!! This is why I wanted to use a member property on this matter, can
you help me?

Thanks a lot


"HWUK" wrote:

Try this code as the default member in the time dim.

Tail(Filter([Time].[Month].Members, NOT
IsEmpty(Time.CurrentMember)),1).Item(0)

Is this the kind of thing your looking for?

"Miguel Salles" wrote:

Hi,

I have a cube with my sales data. I'd like user to have the posibility to
use a "Today Sales", a "This Week Sales". How can I do this?
I thought of somehow using a dimension member property but I don't know how.
My source for the time dimension is a relational table that has 3 extra
columns name Current Date, Current Week and Current Month all of them are
datetime columns populated on the specific rows Like the CurretDate field is
always populated on a single record that shows wich day is today and so on.
Can I use this?

Thanks


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.