dbTalk Databases Forums  

Calculated Member solution (Dave, Deepak)

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


Discuss Calculated Member solution (Dave, Deepak) in the microsoft.public.sqlserver.olap forum.



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

Default Calculated Member solution (Dave, Deepak) - 09-16-2005 , 11:08 AM






Hi,

I have a business requirement where in which the logic of a calculated
member (MDX Expression) depends upon whether a particular dimension say
[Gender] is selected as a ROW dimension or not.

I have written the following MDX expression with in the Analysis Manager for
the cube and it works perfectly fine.

IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Yes Logic Goes
Here", "No Logic Goes Here")

Now we have moved to 64-bit MSAS and it did not support “INSTR” function.
Can you please suggest any other MDX way to find out if a particular
dimension is selected as a ROW or COLUMN dimension and correspondingly change
the logic in the calculated member?

Also, is Microsoft going to implement VBA like functions such as “INSTR”,
“LEN” etc in the immediate release (64bit) versions?

Thanks a lot,

Prasad.


Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Calculated Member solution (Dave, Deepak) - 09-17-2005 , 01:03 AM






It's a bit hard to say without knowing more specifics, but another
option might be to check if the current Gender dimension is not the
default member.

eg.

IIF(NOT [Gender].currentmember is [Gender].[All Gender], "Yes Logic Goes
Here", "No Logic Goes Here")

--
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbell

In article <DF9331F2-277E-43E5-8A2E-E9CCD983D9C2 (AT) microsoft (DOT) com>,
Prasad (AT) discussions (DOT) microsoft.com says...
Quote:
Hi,

I have a business requirement where in which the logic of a calculated
member (MDX Expression) depends upon whether a particular dimension say
[Gender] is selected as a ROW dimension or not.

I have written the following MDX expression with in the Analysis Manager for
the cube and it works perfectly fine.

IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Yes Logic Goes
Here", "No Logic Goes Here")

Now we have moved to 64-bit MSAS and it did not support ⤽INSTR⤝ function.
Can you please suggest any other MDX way to find out if a particular
dimension is selected as a ROW or COLUMN dimension and correspondingly change
the logic in the calculated member?

Also, is Microsoft going to implement VBA like functions such as ⤽INSTR⤝,
⤽LEN⤝ etc in the immediate release (64bit) versions?

Thanks a lot,

Prasad.



Reply With Quote
  #3  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Calculated Member solution (Dave, Deepak) - 09-17-2005 , 01:40 AM



Hi Prasad,

The only solution without VBA functions, that I could come up with so
far, uses a calculated cell to scan all dimensions of a row tuple for
the [Gender] dimension. This technique was shown in Chris Webb's blog
entry below. For the Foodmart Sales cube, a sample query looks like:

Quote:
With
Set [RowTuple] as
'StrToSet("Head(Axis(1))")'
Member Measures.[YesText] as '"Yes"'
MEMBER MEASURES.[GenderOnRows] AS '"No"'
CELL CALCULATION ScanDims FOR '({MEASURES.[GenderOnRows]})' AS
'iif([RowTuple].Item(0).Item(129 - CALCULATIONCURRENTPASS()).Dimension
is [Gender],
Measures.[YesText], CALCULATIONPASSVALUE(MEASURES.[GenderOnRows], -1,
RELATIVE))',
CALCULATION_PASS_NUMBER=129, CALCULATION_PASS_DEPTH=128, SOLVE_ORDER =
10,
CONDITION='129 - CALCULATIONCURRENTPASS() < [RowTuple].Item(0).Count'

SELECT {[Measures].[Unit Sales], MEASURES.[GenderOnRows]} ON columns,
Non Empty Crossjoin([Gender].[Gender].Members,
[Marital Status].[Marital Status].Members) on rows
FROM SALES
Quote:

http://spaces.msn.com/members/cwebbbi/Blog/cns!1pi7ETChsJ1un_2s41jm9Iyg!
130.entry


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #4  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Calculated Member solution (Dave, Deepak) - 09-19-2005 , 07:36 PM



As far as 64-bit is concerned, in the 2005 release we have re-written
standard VBA functions natively so you won't run into this problem with
2005.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Prasad" <Prasad (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I have a business requirement where in which the logic of a calculated
member (MDX Expression) depends upon whether a particular dimension say
[Gender] is selected as a ROW dimension or not.

I have written the following MDX expression with in the Analysis Manager
for
the cube and it works perfectly fine.

IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Yes Logic Goes
Here", "No Logic Goes Here")

Now we have moved to 64-bit MSAS and it did not support "INSTR" function.
Can you please suggest any other MDX way to find out if a particular
dimension is selected as a ROW or COLUMN dimension and correspondingly
change
the logic in the calculated member?

Also, is Microsoft going to implement VBA like functions such as "INSTR",
"LEN" etc in the immediate release (64bit) versions?

Thanks a lot,

Prasad.




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.