The integration with respect to a vector measure may be applied in order to approximate a function in a Hilbert space by means of a finite orthogonal sequence $\{f_i\}$ attending to two different error criterions. In particular, if $\Omega\in\mathbb{R}$ is a Lebesgue measurable set, $f\in L_2(\Omega)$ , and $\{A_i\}$ is a finite family of disjoint subsets of $\Omega$ , we can obtain a measure $\mu_0$ and an approximation $f_0$ satisfying the following conditions: (1) $f_0$ is the projection of the function $f$ in the subspace generated by $\{f_i\}$ in the Hilbert space $f\in L_2(\Omega,\mu_0)$ . (2) The integral distance between $f$ and $f_0$ on the sets $\{A_i\}$ is small.