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{fi}attending to two different error criterions. In particular, ifΩ∈ℝis a Lebesgue measurable set,f∈L2(Ω), and{Ai}is a finite family of disjoint subsets ofΩ, we can obtain a measureμ0and an approximationf0satisfying the following conditions: (1)f0is the projection of the functionfin the subspace generated by{fi}in the Hilbert spacef∈L2(Ω,μ0). (2) The integral distance betweenfandf0on the sets{Ai}is small.