I would like to know how can i sort values from a table based on hierarchy values of a field.

EX:

```
A     B 
--------
1     A 
2     F
3     A
4     P
5     O
6     F

```

I would like sort the values by the B field and appear first the F Values, then A values, then P values and in the end the O values.

In the end, the result must be like this:

```
2   F
6   F
1   A
3   A
4   P
5   O

```