3

Even though I found similar questions, I couldn't find a suitable answer for the problem I have.

I want to create a model that calculates the difference between two fields ("NUMPOINTS") from different vector files and populate a new field with the result in a new vector file.

My input are 2 vector layers: 'Events A' and 'Events B'. These tables have the same fields, including a common "id" field.

I need to create a 'Table C' where "DIFFERENCE" field is calculated as follow: "NUMPOINTS" ('Table B') - "NUMPOINTS" ('Table A')

So far, I managed to create a Join, but I don't know how to create a new field with input from the two input files.

enter image description here

Taras
35.7k5 gold badges77 silver badges151 bronze badges
asked Aug 26, 2023 at 3:28

1 Answer 1

5

you can use the fieldcalculator in your model to do the calculation:

enter image description here

since your fields have the same name "NUMPOINTS" you can use a prefix for the joind NUMPOINTS field in the JOIN operation:

enter image description here

the formula in the fieldcalculator would be:

enter image description here

answered Aug 26, 2023 at 5:40
1
  • if this answer is a solution to your question you can mark the answer as accepted... Commented Aug 27, 2023 at 9:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.