I would like to solve the following derivative:
$$\frac{\partial}{\partial y_j}\sum_{k \in U}{\sum_{l \in U}{a_k a_lw_kw_l|y_k-y_l|}}$$
where U is a population and the variable $a$ is equal to "1" if the unit is selected to be part of a sample and "0" otherwise.
The derivative of the absolute value is undefined for argument $0$ and is the sign function elsewhere.
Then the derivative on $y_j$:
$$\frac{\partial}{\partial y_j}\sum_{k \in U}{\sum_{l \in U}{a_k a_lw_kw_l|y_k-y_l|}}=\\ \sum_{k \in U}\sum_{l \in U}(a_k a_lw_kw_l\text{ sgn}(y_k-y_l)\delta_{jk}-a_k a_lw_kw_l\text{ sgn}(y_k-y_l)\delta_{jl})=\\ \sum_{l \in U}a_j a_lw_jw_l\text{ sgn}(y_j-y_l)-\sum_{k \in U}a_k a_jw_kw_j\text{ sgn}(y_k-y_j).$$