  The main goal of this paper is to compute two related numerical invariants of
a primitive ideal in the universal enveloping algebra of a semisimple Lie
algebra. The first one, very classical, is the Goldie rank of an ideal. The
second one is the dimension of an irreducible module corresponding to this
ideal over an appropriate finite W-algebra. We concentrate on the integral
central character case. We prove, modulo a conjecture, that in this case the
two are equal. Also, modulo the same conjecture, we compute certain scale
factors introduced by Joseph. Our conjecture asserts that there is a
one-dimensional module over the W-algebra with certain additional properties.
The conjecture is proved for the classical types. This completes a program of
computing Goldie ranks proposed by Joseph in the 80's.
  We also provide an essentially Kazhdan-Lusztig type formula for computing the
characters of the irreducibles in the Brundan-Goodwin-Kleshchev category O for
a W-algebra again under the assumption that the central character is integral.
The formula is based on a certain functor (a generalized Soegel functor) from
an appropriate parabolic category O to the W-algebra category O. We prove a
number of properties of this functor including the quotient property and the
double centralizer property.
  We develop several topics related to our generalized Soergel functor. For
example, we discuss its analog for the category of Harish-Chandra bimodules. We
also discuss generalizations to the case of categories O over Dixmier algebras.
The most interesting example of this situation comes from the theory of quantum
groups: we prove that an algebra that is basically Luszitg's form of a quantum
group at a root of unity is a Dixmier algebra. For this we check that the
quantum Frobenius epimorphism splits.
