dbTalk Databases Forums  

Filter by date on a member property

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


Discuss Filter by date on a member property in the microsoft.public.sqlserver.olap forum.



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

Default Filter by date on a member property - 05-23-2006 , 08:29 AM






Hi

I am trying to filter out records which have a member property of
greater than a certain date.
EG Member property of Date Created and I want to see all members
created after a certain date. How would this work in MDX?

I have tried the following

SELECT { [Time].DEFAULTMEMBER } ON COLUMNS ,
{Filter([BOM Production].[Prod No].Members, VAL
([BOM Production].CurrentMember.Properties("Created Date")) >
01/01/2000 )} ON ROWS
FROM [Production]
WHERE ( [Measures].[Production Qty Started] )

If I remove the VAL part of this I get a "token not valid" error when
parsing the query. The property Created Date field is a proper DateTime
field. I need to know what would work with this. I have tried
substituting VAL with DATE, TIME and also removing the VAL altogether.
None of this has worked.


Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Filter by date on a member property - 05-24-2006 , 07:10 AM






Maybe try using CDATE() instead of VAL()

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1148390981.286616.24010 (AT) 38g2000cwa (DOT) googlegroups.com>,
alanmidwinter (AT) hotmail (DOT) com says...
Quote:
Hi

I am trying to filter out records which have a member property of
greater than a certain date.
EG Member property of Date Created and I want to see all members
created after a certain date. How would this work in MDX?

I have tried the following

SELECT { [Time].DEFAULTMEMBER } ON COLUMNS ,
{Filter([BOM Production].[Prod No].Members, VAL
([BOM Production].CurrentMember.Properties("Created Date"))
01/01/2000 )} ON ROWS
FROM [Production]
WHERE ( [Measures].[Production Qty Started] )

If I remove the VAL part of this I get a "token not valid" error when
parsing the query. The property Created Date field is a proper DateTime
field. I need to know what would work with this. I have tried
substituting VAL with DATE, TIME and also removing the VAL altogether.
None of this has worked.



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

Default Re: Filter by date on a member property - 05-25-2006 , 05:31 AM



Thought you should know that the solution was as follows

SELECT{ [Time].DEFAULTMEMBER, [Time].[Created Date] } ON COLUMNS ,
{Filter([BOM Production].[Prod No].Members, CDATE
([BOM Production].CurrentMember.Properties("Created Date")) >
datevalue("01/01/2003") )} ON ROWS

FROM [Production]

I was not using the datevalue function for converting the tring I typed.


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.