I've offended God by dividing by zero
Hi guys!! Is there any automatized way in SSRS to skip the #Error when "someone" divided by zero? Thanks ;)
June 26th, 2012 5:46am

Hi There Thanks for your posting, it would be good if you share your expression but any way I will try but make sure chnage your fields value with my one -- You can either use this one =IIF((Fields!Target.Value = 0 or Fields!Target.Value is nothing), 0, Fields!Actual.value/IIF(Fields!Target.Value = 0 or Fields!Target.Value is nothing, 1,(Fields!Target.Value) )) If you would like you can see this http://social.technet.microsoft.com/wiki/contents/articles/11692.percentage-of-actual-vs-target.aspx I will look forward to hear from you soon If you have any question please do ask Many thanks Syed Qazafi Anjum
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2012 6:02am

I've a lot of large expressions here... I was looking for something like OnError(expression, 0) so it'll return 0 if the expression contains an #Error or NauN
June 26th, 2012 6:10am

Hi There Thanks for your posting please use the expression as I have mentioned above, you have to check if the value is nothing and zero for deviser, this will make sure to avoid error like infinity NAN or #error, Please also have a look on the link I have provided you above , I have explained things in details If you have any question please do ask Many thanks Syed Qazafi Anjum
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2012 6:17am

=Sum(Iif(Fields!time_talking.Value + Fields!time_waiting.Value >= 10 AND Fields!disposition.Value = 1 AND Fields!destiny.Value = 6666 AND Fields!queue.Value = "CSQ_CAU", 1, 0)) / Sum(Iif(Fields!time_talking.Value + Fields!time_waiting.Value >= 10 AND Fields!destiny.Value = 6666 AND Fields!agent.Value >= 1, 1, 0)) That's one of the expressions. Note that there is a lot of records grouped by date.
June 26th, 2012 6:19am

Solved: =Sum(Iif(Fields!tiempo_hablando.Value + Fields!tiempo_cola.Value >= 10 AND Fields!disposicion.Value = 1 AND Fields!telefono_destino.Value = 6666 AND Fields!cola.Value = "CSQ_CAU", 1, 0)) / Iif(Sum(Iif(Fields!tiempo_hablando.Value + Fields!tiempo_cola.Value >= 10 AND Fields!telefono_destino.Value = 6666 AND Fields!agente.Value >= 1, 1, 0)) is nothing, 1, Sum(Iif(Fields!tiempo_hablando.Value + Fields!tiempo_cola.Value >= 10 AND Fields!telefono_destino.Value = 6666 AND Fields!agente.Value >= 1, 1, 0)))
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2012 6:42am

I find it much easier to do this in the stored procedure. It is really handy to write a SQL function that does division and returns the value you want I am sure you would use it in all sorts of other scenarios. Something like: CREATE FUNCTION [dbo].[Division] (@numerator float, @denominator float) RETURNS float AS BEGIN RETURN CASE WHEN @denominator = 0.0 THEN 0.0 ELSE @numerator / @denominator END ENDLucasF
June 27th, 2012 5:26am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics