dbTalk Databases Forums  

date range

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


Discuss date range in the microsoft.public.sqlserver.olap forum.



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

Default date range - 09-09-2003 , 07:08 AM






Hello,


I have been searching newsgroups and the web high and low to find a solution
to my problem. It seems to be a fairly common problem, but I have not found
a proper fix for it.

Below is my MDX, which might as well be off the Foodmart DB:

WITH SET [Date Range] AS '{ [Created].[2002].&[11].[25] :
[Created].[2003].&[9].[9] }'
MEMBER [Created].[Range] AS 'Aggregate([Date Range])'
SELECT { FILTER([Campaign].&[1].Children, [Measures].[Impressions] > 0) }
DIMENSION PROPERTIES [Campaign].[Campaign].Key, [Campaign].[Campaign].Name
ON ROWS,
{ [Measures].[Leads], [Measures].[Impressions], [Measures].[Gross CPL],
[Measures].[eCPL]} ON COLUMNS
FROM iLead_Dashboard
WHERE [Created].[Range]

This works fine. The numbers 2002, 11, 25, 2003, 9 and 9 are populated based
on user input, however. This means, that I cannot be sure that the start
date and end date exist in my "Created" dimension as a members. This, in
turn, would of course cause an error looking something like this "Formula
error - cannot find dimension member ("[Created].[xxxx].&[xx].[xx]") - in a
name-binding function".

How can I work around this (while maintaining functionality) or simply catch
the error and select the nearest date after and before the start date and
end date, respectively?

Any input is appreciated.

Thanks!


/Martin



Reply With Quote
  #2  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: date range - 09-09-2003 , 12:23 PM






The best way to solve this is to only present the user with a valid list of
dates from which there is data available in the cube.

Sean

--
--
Sean Boon
SQL Server BI Product Unit

**This posting is provided AS IS, with no warranties, and confers no
rights.**

"main" <martinskeem (AT) hotmail (DOT) com> wrote

Quote:
Hello,


I have been searching newsgroups and the web high and low to find a
solution
to my problem. It seems to be a fairly common problem, but I have not
found
a proper fix for it.

Below is my MDX, which might as well be off the Foodmart DB:

WITH SET [Date Range] AS '{ [Created].[2002].&[11].[25] :
[Created].[2003].&[9].[9] }'
MEMBER [Created].[Range] AS 'Aggregate([Date Range])'
SELECT { FILTER([Campaign].&[1].Children, [Measures].[Impressions] > 0) }
DIMENSION PROPERTIES [Campaign].[Campaign].Key, [Campaign].[Campaign].Name
ON ROWS,
{ [Measures].[Leads], [Measures].[Impressions], [Measures].[Gross CPL],
[Measures].[eCPL]} ON COLUMNS
FROM iLead_Dashboard
WHERE [Created].[Range]

This works fine. The numbers 2002, 11, 25, 2003, 9 and 9 are populated
based
on user input, however. This means, that I cannot be sure that the start
date and end date exist in my "Created" dimension as a members. This, in
turn, would of course cause an error looking something like this "Formula
error - cannot find dimension member ("[Created].[xxxx].&[xx].[xx]") - in
a
name-binding function".

How can I work around this (while maintaining functionality) or simply
catch
the error and select the nearest date after and before the start date and
end date, respectively?

Any input is appreciated.

Thanks!


/Martin





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.