Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

How can MDX query take parameters to filter by Fact Table datetime attribute

$
0
0

We have a fact table that has a datetime field [Log Entry].[Time Entry].  

We would like to  filter the following query based on a date range:  where the [Log Entry].[Time Entry] was between two supplied dates (2 parameters: i.e. startdate and enddate)

SELECT 
  NON EMPTY { [Measures].[Average Total Time] } ON COLUMNS, 
  NON EMPTY { ([User Property].[UserProperty].[Id].ALLMEMBERS * [Log Entry].[Time Entry].[Logged On].ALLMEMBERS ) } 
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
FROM [MyCube] 

I was hoping to avoid having to create Time Table/dimension and being able to compare those dates (passed in via parameters) against the [Log Entry].[Time Entry].

Concept of SQL's between (somedate Between date1 and date2).

How can we do this?




Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>