dbTalk Databases Forums  

Can't get named set to work in query scoped calculated members

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


Discuss Can't get named set to work in query scoped calculated members in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lars-Erik Aabech
 
Posts: n/a

Default Can't get named set to work in query scoped calculated members - 08-08-2006 , 03:41 AM






Hi!

I've got this query with quite a few calculated members. There's a time
scope involved in each member (at least the way I did the query), and I'd
like to specify it at the top only.. Just can't get it working. Any
hints?

Here's the query:
WITH
-- I'd like to have
-- SET [Period] AS '[View Meter Count].[Time].[Action Year].&[2006].&[1]'
-- or i.e.
-- SET [Period] AS '([View Meter Count].[Time].[Action Year].&[2006].&[1],
[View Meter Count].[Time].[Action Year].&[2006].&[2]))'
-- and use [Period] in all members defined below
-- but I only get #error
MEMBER [Measures].[Installed] AS '
([Measures].[Count], [Action Codes].[New Meter Installation])
'
MEMBER [Measures].[Withdrawn] AS '
([Measures].[Count], [Action Codes].[Meter Withdrawal])
'
MEMBER [Measures].[Beholdning] AS '
[Measures].[Installed] - [Measures].[Withdrawn]
'
MEMBER [Time].[IB] AS '
Aggregate(
PeriodsToDate(
[View Meter Count].[Time].[All].Level,
OpeningPeriod([View Meter Count].[Time].[Action Day],
[View Meter Count].[Time].[Action Year].&[2006].&[1])
),
[Measures].[Beholdning]
)
'
MEMBER [Time].[UB] AS '
Aggregate(
PeriodsToDate(
[View Meter Count].[Time].[All].Level,
ClosingPeriod([View Meter Count].[Time].[Action Day],
[View Meter Count].[Time].[Action Year].&[2006].&[1])
),
[Measures].[Beholdning]
)
'
MEMBER [Time].[InstalledInPeriod] AS '
Aggregate(
{[View Meter Count].[Time].[Action Year].&[2006].&[1]}
,
[Measures].[Installed]
)
'
MEMBER [Time].[WithdrawnInPeriod] AS '
Aggregate(
{[View Meter Count].[Time].[Action Year].&[2006].&[1]}
,
[Measures].[Withdrawn]
)
'
MEMBER [Time].[Diff] AS '
[Time].[UB] - [Time].[IB]
'
MEMBER [Time].[PercDiff] AS '
[Time].[UB] / [Time].[IB]
', FORMAT_STRING = 'Percent'
SELECT
{
[Time].[IB]
,[Time].[UB]
,[Time].[Diff]
,[Time].[PercDiff]
,[Time].[InstalledInPeriod]
,[Time].[WithdrawnInPeriod]
} ON COLUMNS,
(
[Maskinkoder t3].[Produktsegment].Children
, [Maskinkoder t3].[Maskinnavn].Children
) ON ROWS
FROM
[Meter Install And Withdrawal]



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

Default RE: Can't get named set to work in query scoped calculated members - 08-08-2006 , 10:02 PM






Hi Lars,

I understand that you could get named set to work in your MDX script. If
I'm off-base, please let me know.

You may want to test the following syntax to see if it works since we need
a set other than a member:


SET [Period] AS {[View Meter Count].[Time].[Action Year].&[2006].&[1]}

or

SET [Period] AS '{[View Meter Count].[Time].[Action Year].&[2006].&[1]}'

If anything is unclear or you have further questions, please feel free to
let's know. We look forward to your update.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #3  
Old   
Lars-Erik Aabech
 
Posts: n/a

Default Re: Can't get named set to work in query scoped calculated members - 08-09-2006 , 04:00 AM



Hi!

Thanks for your answer. I tried once more, and understood what I did wrong.
I tried to use the [Period] set as an argument to OpeningPeriod which
expects a member. I used [Period].Item(0) for OpeningPeriod (IB member) and
[Period].Item(COUNT([Period]) - 1) for ClosingPeriod (UB member) and that
did the trick..

L-E

""privatenews"" <petery (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Lars,

I understand that you could get named set to work in your MDX script. If
I'm off-base, please let me know.

You may want to test the following syntax to see if it works since we need
a set other than a member:


SET [Period] AS {[View Meter Count].[Time].[Action Year].&[2006].&[1]}

or

SET [Period] AS '{[View Meter Count].[Time].[Action Year].&[2006].&[1]}'

If anything is unclear or you have further questions, please feel free to
let's know. We look forward to your update.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.




Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: Can't get named set to work in query scoped calculated members - 08-10-2006 , 02:09 AM



Hello Lars,

Great to hear you resolved the issue and your experience on this will
surely benefit the community!

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support


================================================== ===


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



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.