move along parent to a new household

11 views
Skip to first unread message

ischoc...@gmail.com

unread,
Oct 5, 2020, 5:37:14 AM10/5/20
to liam2-users

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

Gaëtan de Menten

unread,
Oct 5, 2020, 9:29:36 AM10/5/20
to liam2...@googlegroups.com

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.



Disclaimer: This e-mail may contain confidential information which is intended only for the use of the recipient(s) named above.
If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
Please note that e-mail messages cannot be considered as official information from the Federal Planning Bureau.

ischoc...@gmail.com

unread,
Oct 7, 2020, 6:46:56 AM10/7/20
to liam2-users

Thank you! I'll try it out!
Ingrid
Reply all
Reply to author
Forward
0 new messages