The weight hierarchy of a linear [n, k; q] codeC overGF(q) is the sequence (d 1,d 2, …,d k) whered r is the size of the smallest support of anr-dimensional subcode ofC. An [n, k; q] code satisfies the chain condition if there exists subcodesD 1⊂D 2⊂…⊂D k=C ofC such thatD r has dimensionr and support of sized r for allr. Further,C satisfies the almost chain condition if it does not satisfy the chain condition, but there exist subcodesD r of dimensionr and support of sized r for allr such thatD 2⊂D 3⊂…⊂D k=C andD 1⊂D 3. A simple necessary condition for a sequence to be the weight hierarchy of a code satisfying the almost chain condition is given. Further, explicit constructions of such codes are given, showing that in almost all cases, the necessary conditions are also sufficient.