dbTalk Databases Forums  

retrieving data for a specific date range

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


Discuss retrieving data for a specific date range in the microsoft.public.sqlserver.olap forum.



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

Default retrieving data for a specific date range - 05-24-2006 , 05:36 PM






Hello,

How would you filter data so that you only get back values for a
particular date range, such as the last seven days. This is the query
I'm using:

SELECT { [Measures].[Sampled Value] } ON COLUMNS,
{ FILTER( [Time Sampled].[Minute].members, [Measures].[Sampled Value]
<> 0 ) } ON ROWS
FROM MOM_Performance
WHERE ( [Computer].[Computer Name].[DEV1], [Performance Names].[%
Processor Time] )

which is good because now it only returns cells (or are they tuples?)
that actually have data in them (the process was being sampled every 15
minutes, so I would have a long series of 14 empty rows). But once I
put that filter in, I'm having difficulty in adding another. I tried
using AND and OR, but to no avail. Any suggestions on this, or on the
general idea of restricting the query to a particular date range?

Thanks!


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: retrieving data for a specific date range - 05-24-2006 , 07:11 PM






Assuming that the date is included higher up the [Time Sampled]
dimension hierarchy:

Quote:
SELECT {[Measures].[Sampled Value]} ON COLUMNS,
FILTER(Descendants(Tail(NonEmptyCrossJoin(
[Time Sampled].[Date].Members), 7),
[Time Sampled].[Minute]),
[Measures].[Sampled Value] <> 0) ON ROWS
FROM MOM_Performance
WHERE ([Computer].[Computer Name].[DEV1],
[Performance Names].[% Processor Time])
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.