I have been trying to merge about 40 layers for a while now but I keep getting this error message: {} field in layer {} has different data type than in other layers.

I have actually done in before and it worked and I have to redo it again but for some reason it is not working. Any help please on what the problem could be?

  • 1
    Which QGIS version? Which tool have you been trying? Have any of the layer's schemas changed since your previously successful efforts?
    – Stu Smith
    Commented Jun 12, 2018 at 14:19
  • 1
    The error message seems pretty clear that somewhere in those 40 layers, something isn't compatible with the rest. Could you elaborate on what these layers are? Maybe provide a screenshot of them or something? Another idea: try merging layers in smaller groups, then merge the groups. This could at least narrow down where the "wrong" layer is.
    – jcarlson
    Commented Jun 12, 2018 at 14:20
  • I am using QGIS 2.18. sorry please what is schemas?
    – user118372
    Commented Jun 12, 2018 at 14:27
  • the layers are 40 different shapefiles of the states of a country. Now i want to merge them into one layer so I dont have too many icons on my layer panel. Must all the layers be created at the same time? Since the one i originally created did not open, I decided to correct 6 of them which i also did previously and now it is giving me this error.
    – user118372
    Commented Jun 12, 2018 at 14:33
  • It would help if we could see a sample of the data. Also, specify what fields your layers contain. One problem could be that you are trying to merge layers where fields of the same name contain different data types.
    – Gabriel
    Commented Jun 12, 2018 at 15:16

1 Answer 1


I'd suggest temporarily installing qgis 3.0 to do the merge. The merge algorithm in 3.0 was made much more forgiving, and automatically handles things like upgrading single part geometries to multipart if any of the input layers are multipart. Additionally it can correctly handle layers with different crs. You could perform the merge in 3.0 and then return to 2.18 for the rest of your work.

  • Thank you so much! I installed the QGIS 3.0. It did not only work it showed me the exact file that had a problem and what the problem was.
    – user118372
    Commented Jun 13, 2018 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.