dbTalk Databases Forums  

Filter and Tail

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


Discuss Filter and Tail in the microsoft.public.sqlserver.olap forum.



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

Default Filter and Tail - 05-05-2004 , 03:40 PM






I have several ProClarity Briefing Books that use a Date Dimension on the
Rows and an Hours Dimension on the Columns and sales people analyze two or
three days at a time for sales by hour. I would like to automatically load
the current and two days past when the User fetches the Briefing book. I am
going to basically modify a My Item Set (A ProClarity construct) that has
three days selected so that it will provide information to an MDX expression
that will cause the whole fetch to load the current date and the last two. I
have been experimenting with the Filter and Tail functions, but haven't been
able to get it right yet. Here is a basic expression that gives me the
hours, but I have been unable to figure out how to use the Filter and then
the Tail functions to return just the current and last two days.

SELECT NON EMPTY { [Hours].[All Hours].CHILDREN } ON COLUMNS , NON EMPTY
[Date].[All Date].Children
ON ROWS FROM [HAS 70 Day Test Cube] WHERE ( [Measures].[Revenue] )

Basically what I need is a good example of how the Filter and Tail functions
can work together. Thanks for the help.

CB





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

Default Filter and Tail - 05-05-2004 , 10:20 PM






See this past post, which shows some sample MDX:

http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF-
8&selm=ug1k9zBqBHA.2180%40tkmsftngp07
Quote:
From: Tim Harris (tharris (AT) oneprice (DOT) com)
Subject: Re: Date (Today)
View: Complete Thread (4 articles)
Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2002-01-28 09:04:09 PST


That depends on your time dimension and how you populate
your cube. If today
is the last day in the time dimension to have any data you
could use the
filter function to test for the days with data and then
use Tail and Item to
get the last member.

Maybe something like:
Tail((Filter(Descendants([Time].[All Time] ,[Time].[Day]),
([Measures].[Sales])<>0)),1).Item(0)

You might be able to put a date propety on the day level
of your cube that
you could use along with a VB date/time function (i
haven't tried this).

"news.mch.sbs.de" <stephen.waters (AT) con (DOT) siemens.co.uk> wrote
in message
news:a339qj$okv$1 (AT) news (DOT) mch.sbs.de...
Quote:
Hi,
I've been using Analysis services with Pro Clarity
as a frontend for
some time now but have never had to write any serious
MDX as yet, how do I
get a view to default to "todays" date,

Cheers,
Steve.





Quote:
-----Original Message-----
I have several ProClarity Briefing Books that use a Date
Dimension on the
Rows and an Hours Dimension on the Columns and sales
people analyze two or
three days at a time for sales by hour. I would like to
automatically load
the current and two days past when the User fetches the
Briefing book. I am
going to basically modify a My Item Set (A ProClarity
construct) that has
three days selected so that it will provide information
to an MDX expression
that will cause the whole fetch to load the current date
and the last two. I
have been experimenting with the Filter and Tail
functions, but haven't been
able to get it right yet. Here is a basic expression that
gives me the
hours, but I have been unable to figure out how to use
the Filter and then
the Tail functions to return just the current and last
two days.

SELECT NON EMPTY { [Hours].[All Hours].CHILDREN } ON
COLUMNS , NON EMPTY
[Date].[All Date].Children
ON ROWS FROM [HAS 70 Day Test Cube] WHERE ( [Measures].
[Revenue] )

Basically what I need is a good example of how the Filter
and Tail functions
can work together. Thanks for the help.

CB




.


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.