1

I am using QGIS and I have two layers the first one is "Reading" layer with the attribute details

example1

The second layer is "Reading_History" layer with the attribute details

example2

I want to use the expression functions in the default value field to take the last date reading from "Reading_History" layer attribute and update the "Reading" layer with it based on the "ID"` field.

example3

So when a new record for a specific "ID" added to "Reading_History" attribute the "Reading" attribute will be automatically updated to the latest "Reading". I wonder if there is such a function code to use in the expression calculator that may give the result above.

  • 1
    Use a virtual field instead of a default value. The "apply default value on update" setting works only when that layer updates, it doesn't work when other layers update. – csk Sep 16 at 16:28
  • Many thanks @csk. I will learn how to use it because I didn't use it before. – Ahmed Alaa Sep 19 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.