dbTalk Databases Forums  

HELP on IIF function HOW TO DO

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


Discuss HELP on IIF function HOW TO DO in the microsoft.public.sqlserver.olap forum.



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

Default HELP on IIF function HOW TO DO - 03-14-2006 , 04:12 AM






In Analysis Services : Calculated Members

How do I perform a test like this:

if ProjectCategoryID = "some_value" then return VALUE1 else return VALUE2

Found the IIF function but not familiar with the syntax.... Will only return
#ERR or some errormessage

The formula should look something like this.....

iif([ProjectCategory].[Project Category Id] =
"FP_Revenue",[Measures].[SalesAmount_RevenueHC],0)

The dimension [ProjectCategory] has only one level [Project Category Id]


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

Default Re: HELP on IIF function HOW TO DO - 03-14-2006 , 07:11 AM






You might be looking to syntax:
iif([ProjectCategory].[Project Category Id].CurrentMember.Name =
"FP_Revenue",[Measures].[SalesAmount_RevenueHC],0)

Vimmas

"Tale Liereng" <TaleLiereng (AT) discussions (DOT) microsoft.com> wrote

Quote:
In Analysis Services : Calculated Members

How do I perform a test like this:

if ProjectCategoryID = "some_value" then return VALUE1 else return VALUE2

Found the IIF function but not familiar with the syntax.... Will only
return
#ERR or some errormessage

The formula should look something like this.....

iif([ProjectCategory].[Project Category Id] =
"FP_Revenue",[Measures].[SalesAmount_RevenueHC],0)

The dimension [ProjectCategory] has only one level [Project Category Id]




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

Default Re: HELP on IIF function HOW TO DO - 03-15-2006 , 04:02 AM



Another option would be to do an "IS" comparison on an actual member,
you also then have the option to link to the member ID rather than the
name which should insulate you against possible changes in the member
name and I believe has a performance advantage over doing a string
comparison.


iif([ProjectCategory].[Project Category Id].CurrentMember IS
[ProjectCategory].[Project Category Id].&[<id>],[Measures].
[SalesAmount_RevenueHC],0)


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

In article <Oi7YIj2RGHA.1844 (AT) TK2MSFTNGP12 (DOT) phx.gbl>, Vimas (AT) nospam (DOT) nospam
says...
Quote:
You might be looking to syntax:
iif([ProjectCategory].[Project Category Id].CurrentMember.Name =
"FP_Revenue",[Measures].[SalesAmount_RevenueHC],0)

Vimmas

"Tale Liereng" <TaleLiereng (AT) discussions (DOT) microsoft.com> wrote in message
news:64CD0F53-1988-4021-A3D1-226292C0E479 (AT) microsoft (DOT) com...
In Analysis Services : Calculated Members

How do I perform a test like this:

if ProjectCategoryID = "some_value" then return VALUE1 else return VALUE2

Found the IIF function but not familiar with the syntax.... Will only
return
#ERR or some errormessage

The formula should look something like this.....

iif([ProjectCategory].[Project Category Id] =
"FP_Revenue",[Measures].[SalesAmount_RevenueHC],0)

The dimension [ProjectCategory] has only one level [Project Category Id]





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.