Re: iif() problem



There is a well-known issue when combining a string with NULL in iif(),
which you may be encountering. Using a second measure to "hide" the text
may work, like:

[Measures].[Text1] :
>>
Right([Measures].[Codigo Data Venc Titulo],2) + "/" +
Mid([Measures].[Codigo Data Venc Titulo], 5, 2) + "/" +
Left([Measures].[Codigo Data Venc Titulo],4)
>>

[Measures].[Text2] :
>>
iif(IsEmpty([Measures].[Codigo Data Venc Titulo]),
NULL, [Measures].[Text1])
>>


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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



Relevant Pages

  • Re: How to return Null in IIF (MDX)
    ... There is a well-known issue when combining a string with NULL in iif, ... Deepak Puri ... Microsoft MVP - SQL Server ... Prev by Date: ...
    (microsoft.public.sqlserver.olap)
  • Re: Text in measures
    ... There is a well-known issue when combining a string with NULL in iif(), ... which you may be encountering. ... Deepak Puri ...
    (microsoft.public.sqlserver.olap)
  • Re: Calculated cell aggregation with parent child
    ... that only measures are calc'ed up the hierarchy. ... you would need to retrieve the strongly-type value (otherwise, ... Returns a string, or a strongly-typed value, that contains a member ... Deepak Puri ...
    (microsoft.public.sqlserver.olap)
  • split()s pattern argument
    ... 'Encountering something weird, ... a scalar, I get behavior other than what I expected. ... with the simple string example (I know ... pattern) I get the correct results, which are simply the first word and the ...
    (comp.lang.perl.misc)
  • Re: Filtering using member key in mdx query
    ... Maybe I'm missing something, but if you have the member name, why can't ... you use it in the where slicer? ... If it's available as a string, ... Deepak Puri ...
    (microsoft.public.sqlserver.olap)