 Welcome to MapForums!

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.   ## DivideByField doesn't work property with 0 value

This is a discussion on DivideByField doesn't work property with 0 value within the MapPoint Desktop Discussion forums, part of the Map Forums category; If I do a datamapping with my personal data and I choose to divide a field by another one (in ...

1. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## DivideByField doesn't work property with 0 value

If I do a datamapping with my personal data and I choose to divide a field by another one (in one record this field is 0), the record with the DivideByField value equal to 0 isn' considered.
Let me show you an example

Amount2003 Amount2002
100 2
300 4
500 0

I want to calculate the Total amount of 2003 divided by Total Amount of 2002 per Region (in this case, I suppose I have only one region)

I choose for the datamapping:
field = Amount2003
DivideByField = Amount2002
Operation: sum

The result is (100+300)/(2+4) instead of (100+300+500)/(2+4+0)

Why?  Reply With Quote

2. Member Yellow Belt
Join Date
Feb 2003
Posts
48
Its the old "What shall I do with infinity?" problem.
Try doing all the calculations external from MP (in XL for example), then you can replace all errors with meaningful values e.g. #DIV/0! --> 0 before import.
You may need to import a couple of datasets (a summary and a detail)

HTH

M.  Reply With Quote

3. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137
I think it's correct that MapPoint will return infinite from Value/0, but it's non correct that performs single operations (Value1/0, Value2/3) etc.
It could only check if the sum of values (0 + 3 +4) is different from 0!

In my previous example

The result is (100+300+500)/(2+4+0), Mappoint could check if (2 + 4+ 0) is different from 0, why it checks 500/0 and then delete that information??  Reply With Quote

There are currently 1 users browsing this thread. (0 members and 1 guests)

dividebyfield, property, work 