Filter options on child table select field using link field on parent form

Good day, guys.
I need your assistance to solve this challenge;
I want to filter options using two select fields in a child table when link field on parent form is selected.
below are fields to filter;
1.boq_code: link field on parent form to another doctype BOQ
2.element: select field on child table
3.sub_element: select field on child table.

I want to filter element select field value on child table when boq_code field value on parent doctype is selected, and also filter sub_element field value on child table when element field value is selected on the child table.
I really need ones help