Flow and hierarchy structure in financial and economic networks