dbTalk Databases Forums  

Divide by null error

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


Discuss Divide by null error in the microsoft.public.sqlserver.olap forum.



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

Default Divide by null error - 02-19-2004 , 11:51 AM






I am trying to write a calculated measure formula that
will give me the growth of a measure over the prior time
period but only if that time period exists.

I used */ IIF(IsEmpty([Time].CurrentMember.Lag(1)), NULL,
*/ to try and work around the issue of a non-existent
prior period.


IIF(IsEmpty([Time].CurrentMember.Lag(1)), NULL,
(([Time].CurrentMember, [Measures].[Pct Voluntary
Closure]) - ([Time].CurrentMember.Lag(1), [Measures].[Pct
Voluntary Closure]) ) / ([Time].CurrentMember.Lag(1),
[Measures].[Pct Voluntary Closure]))


Thanks in advance for your help

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.