dbTalk Databases Forums  

Replace - simple MDX question

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


Discuss Replace - simple MDX question in the microsoft.public.sqlserver.olap forum.



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

Default Replace - simple MDX question - 03-22-2005 , 05:47 AM






I am using the following MDX statement to retrun data to populate a drop down
list allowing the user to select a time period:

WITH
MEMBER [Measures].[DisplayName] AS
'SPACE([Period].CurrentMember.Level.Ordinal * 4) +
[Period].CurrentMember.Name'
MEMBER [Measures].[UniqueName] AS '[Period].CurrentMember.UniqueName'

SELECT
{[Measures].[UniqueName], [Measures].[DisplayName]} ON Columns,
[Period].Members ON Rows

FROM MyCube

The idea of the "SPACE([Period].CurrentMember.Level.Ordinal * 4)" bit in the
first MEMBER declaration is to provide indentation to give a sense of the
hierarchy in the drop down list display.

I now need to serve a client application that doesn't allow leading spaces
in the drop down list display. Is there a function I can use instead of SPACE
to put an alterntive indentation character at the start?

For example, a hyphen. So the returned data would look something like:

ALL
--2004
----Qtr1
------Jan
------Feb
------Mar



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

Default RE: Replace - simple MDX question - 03-22-2005 , 12:07 PM






WITH
MEMBER [Measures].[DisplayName] AS
'String([Period].CurrentMember.Level.Ordinal * 4, "-") +
[Period].CurrentMember.Name'
MEMBER [Measures].[UniqueName] AS '[Period].CurrentMember.UniqueName'

SELECT
{[Measures].[UniqueName], [Measures].[DisplayName]} ON Columns,
[Period].Members ON Rows

FROM MyCube


"Dave Morrow" wrote:

Quote:
I am using the following MDX statement to retrun data to populate a drop down
list allowing the user to select a time period:

WITH
MEMBER [Measures].[DisplayName] AS
'SPACE([Period].CurrentMember.Level.Ordinal * 4) +
[Period].CurrentMember.Name'
MEMBER [Measures].[UniqueName] AS '[Period].CurrentMember.UniqueName'

SELECT
{[Measures].[UniqueName], [Measures].[DisplayName]} ON Columns,
[Period].Members ON Rows

FROM MyCube

The idea of the "SPACE([Period].CurrentMember.Level.Ordinal * 4)" bit in the
first MEMBER declaration is to provide indentation to give a sense of the
hierarchy in the drop down list display.

I now need to serve a client application that doesn't allow leading spaces
in the drop down list display. Is there a function I can use instead of SPACE
to put an alterntive indentation character at the start?

For example, a hyphen. So the returned data would look something like:

ALL
--2004
----Qtr1
------Jan
------Feb
------Mar



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.