Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Divide by Zero frustration Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, January 17, 2012 10:04 AM
 SSC-Insane Group: General Forum Members Last Login: Wednesday, April 13, 2016 12:23 AM Points: 20,643, Visits: 9,671
 SSRS is annoying with that.Use this code to do the division (rename as you wish, this is not Ms Access after all! ).PUBLIC FUNCTION NDZ(Numerator, Denominator, DZResult)IF Denominator = 0 THEN RETURN DZResultELSE RETURN Numerator / Denominator END IFEND FUNCTION
Post #1237358
 Posted Sunday, January 22, 2012 1:38 PM
 SSC Rookie Group: General Forum Members Last Login: Monday, May 30, 2016 5:57 AM Points: 35, Visits: 53
 My problem was to display zero if the value of the denominator is zero, else the division of the two fields.So what I used is mentioned below,iff(Field2=0,0,Field1/Field2)I worked.. Hope it does the same for you all...
Post #1239959
 Posted Thursday, January 26, 2012 1:03 PM
 Grasshopper Group: General Forum Members Last Login: Tuesday, April 29, 2014 6:13 AM Points: 11, Visits: 409
 @penelsonre:=((Sum(Fields!field3.Value) / Sum(Fields!field1.Value) * 10 + Sum(Fields!field4.Value) / Sum(Fields!field1.Value) * 10 + Sum(Fields!field5.Value) / Sum(Fields!field1.Value) * 10 + Sum(Fields!field6.Value) / Sum(Fields!field1.Value) * 10) - (Sum(Fields!field7.Value) / Sum(Fields!field2.Value) * 10 + Sum(Fields!field8.Value) / Sum(Fields!field2.Value) * 10 + Sum(Fields!field9.Value) / Sum(Fields!field2.Value) * 10 + Sum(Fields!field10.Value) / Sum(Fields!field2.Value) * 10)) / (Sum(Fields!field7.Value) / Sum(Fields!field2.Value) * 10 + Sum(Fields!field8.Value) / Sum(Fields!field2.Value) * 10 + Sum(Fields!field9.Value) / Sum(Fields!field2.Value) * 10 + Sum(Fields!field10.Value) / Sum(Fields!field2.Value) * 10) shouldn't the operand before Sum(Fileds!field7.Value) be a '+' sign?
Post #1242425
 Posted Friday, January 27, 2012 4:40 AM
 SSCertifiable Group: General Forum Members Last Login: Thursday, December 1, 2016 11:26 AM Points: 7,502, Visits: 8,651
Post #1242737
 Posted Monday, March 18, 2013 8:52 AM
 SSC-Enthusiastic Group: General Forum Members Last Login: Thursday, November 17, 2016 2:51 AM Points: 120, Visits: 523
 =IIf( IsNothing(Sum(Fields!divisor.Value)) Or Sum(Fields!divisor.Value) = 0.0, "", Sum(Fields!value.Value) / IIf(IsNothing(Sum(Fields!divisor.Value)) Or Sum(Fields!divisor.Value) = 0.0, 1, Sum(Fields!divisor.Value)) )I just wanted to add a fact:If you have a division, that does not allow you to use the divisor "1" instead of "Nothing" you can still use the suggested solutions in this tread:What you have to do is use your conditions twice: first your "old" way: IIf(Sum(Fields!divisor.Value) = 0.0, "", ...Then in the dvision: ...Value) / IIf(IsNothing(Sum(Fields!divisor.Value)) Or Sum(Fields!divisor.Value) = 0.0, 1, Sum(...As you can see, you still have a divsion by 1 implemented but it can never be reached as you ruled it out before.That makes the renderer and you happy ;)
Post #1432218
 Posted Tuesday, October 8, 2013 9:46 AM
 Forum Newbie Group: General Forum Members Last Login: Friday, June 12, 2015 9:43 PM Points: 3, Visits: 31
 Nifty trick....thanks for that.
Post #1502689
 Posted Monday, September 22, 2014 7:22 AM
 SSC Rookie Group: General Forum Members Last Login: Wednesday, January 7, 2015 5:55 AM Points: 36, Visits: 44
 I tried this approach. it ddn't work for me. please help me..Public Function Divider (ByVal Dividend As Double, ByVal Divisor As Double)If IsNothing(Divisor) Or Divisor = 0 Return 0 Else Return Dividend/DivisorEnd IfEnd Function =Code.Divider(cstr(cint(Sum(Fields!DRGMatch.Value),CountDistinct(Fields!LocalID.Value+Fields!UIUserID.Value)*100)))+"%"got the below Error:Textbox16.Paragraphs[0].TextRuns[0]’ contains an error: [BC30198] ')' expected._
Post #1618280
 Posted Monday, September 22, 2014 10:38 AM
 SSCertifiable Group: General Forum Members Last Login: Thursday, December 1, 2016 11:26 AM Points: 7,502, Visits: 8,651
 ashok_k_ghattamaneni (9/22/2014)I tried this approach. it ddn't work for me. please help me..Public Function Divider (ByVal Dividend As Double, ByVal Divisor As Double)If IsNothing(Divisor) Or Divisor = 0 Return 0 Else Return Dividend/DivisorEnd IfEnd Function =Code.Divider(cstr(cint(Sum(Fields!DRGMatch.Value),CountDistinct(Fields!LocalID.Value+Fields!UIUserID.Value)*100)))+"%"got the below Error:Textbox16.Paragraphs[0].TextRuns[0]’ contains an error: [BC30198] ')' expected._ My guess is that you have a paren in the wrong place. Check the bolded text and play around with where the parens should be. Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1618417
 Posted Tuesday, November 3, 2015 11:39 AM
 Forum Newbie Group: General Forum Members Last Login: Friday, February 5, 2016 11:41 AM Points: 3, Visits: 99
 Matt and toolman - Thanks, I needed this!
Post #1733375

 Permissions