dbTalk Databases Forums  

SELECT that return Period-value dynamically

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


Discuss SELECT that return Period-value dynamically in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kaisa M. Lindahl
 
Posts: n/a

Default SELECT that return Period-value dynamically - 04-18-2005 , 07:26 AM






I guess it's a rather cryptic subject text, but I couldn't find better
words.

A client just changed their mind about how to use periods in their reports.
They now want to be able to choose between "Year"; "Half year", "Quarter"
and "Month. (Earlier they wanted to do March 2004-Februar 2005 or October
2004, but we had some calculation problems, and now they want to use preset
period values.)

So, I'm making reports in MS REporting Services. What I want to do, is to
let the customer first choose their period span, like Year, Half year,
Quarter or Month. Depending on what they choose, I want to fill a new drop
down list with the appropriate values. (1st half 2004, 2nd half 2004, 1st
half 2005 etc)

This is my original statement:
with member Measures.NullColumn as 'Null'
select {Measures.NullColumn} on columns,
order ([Perioder].members, [Perioder].currentmember.Name, desc) on rows
from [Prosjekt Komplett]

It returns all years, half years, quarters and months, and sorts it
descending.

What I need is a row of the type of data I've chosen (i.e. years),
preferably with a column name I can use regardless of what sort of period it
is. I want to do something like this:

with
<pseudocode>
member Perioder.MyDynamicPeriod as '[Perioder].[" &
Parameters!PeriodLevel.Value & "]'
</pseudocode>
member Measures.NullColumn as 'Null'
select {Measures.NullColumn} on columns,
order (
<pseudocode>
crossjoin([Perioder].[MyDynamicPeriod],
</pseudocode>
[Perioder].members, [Perioder].currentmember.Name, desc)) on rows
from [Prosjekt Komplett]

Hopefully this will return
MyDynamicPeriod - Years -Half Year - Quarter - Month
- which will make it easier to use in the next drop down list.

I know it's not the right syntax, so I need some suggestions on the syntax
of it all. Or just tell me it can't be done.

All help appreciated.

Kaisa M. Lindahl



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.