On Fri, Jun 12, 2015 at 10:18 AM, Sebastian Andersson <
[email protected]> wrote:

> Hello,
>
> I want to calculate the share of different population Groups in my
> attribute table by using the field calculator.
> I have added a new column in the attribute table and calculated the share
> of young people, by dividing the number of young people with the total
> number of people.
> The new values are added to the new column. However, after saving, the
> values are lost and the columns show 0. Why?
>

Try

1.0 * young people / total people

The problem seems to be integer division which again results in an integer
value rather than the desired float value.

Best wishes,
Anita
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to