Dear all
Has anyone an idea on how to “move a parent along to a new household”? That is, we have some extended households and if a man seperates, but lives with his parents, we want to move along his parents to a new household.
I can’t find how to do that since the link to children (trough father_id or mother_id) is a one-to-many link.
Thanks in advance!
Ingrid
Assuming the opposite link to father_id is "father_children", I assume something like the following would work:
lived_with_father: new_hh_id == father.hh_id and [some other conditions]
num_lives_with_father: father_children.count(lived_with_father)
# if all the children who lived with their father just moved
child_just_moved: num_lives_with_father > 0 and father_children.count(lived_with_father and just_moved) == num_lives_with_father
hh_id: if(child_just_moved, new_hh_id, hh_id)
Hope it helps,
Gaëtan
--
You received this message because you are subscribed to the Google Groups "liam2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
liam2-users...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/liam2-users/c04ebd6c-64c1-4d30-9a19-c3515b5afe49n%40googlegroups.com.