This is a migrated thread and some comments may be shown as answers.

Divide by zero problem in table field

2 Answers 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shiwani
Top achievements
Rank 1
Shiwani asked on 09 Feb 2017, 01:48 PM

Hello,

I have attached an image of table in report. please refer.

As per attachment, In the field of table where column is '%Completion' (C) and row no is  third(in green), i want division of field (No of  Elearning Courses on Curriculum(A) and No of  Elearning  Courses completed(B)) , but when i use (fields.No of  Elearning Courses on Curriculum / fields.No of  Elearning  Courses completed) the report shows divide by zero error.

please help me to come out of this.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dave
Top achievements
Rank 2
answered on 09 Feb 2017, 02:50 PM

You need to check for zero values when dividing. You can use this expression format:

= IIF(Fields.ColumnB>0, Fields.ColumnA/Fields.ColumnB, 0)
0
Stef
Telerik team
answered on 09 Feb 2017, 03:35 PM
Hi,

You can also use the ?: operator, instead of the IIf function as both sides of the function are evaluated during the processing.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Shiwani
Top achievements
Rank 1
Answers by
Dave
Top achievements
Rank 2
Stef
Telerik team
Share this question
or