You are currently reviewing an older revision of this page.
How do I sort a flextable (such as pipe or conduit) in order of upstream to downstream?
By default, element flextables are ordered by their element ID, which is based on the order that they were drawn or inserted into the model. Sometimes it is necessary to view a flextable in a different order such as upstream-downstrean, not by ID or label. This also allows the user to use the relabel function to change the labels of elements based on the order in the flextable. Our storm and sewer products have an ability to do so because the flow is always in the same direction. However our water modeling products can have flow in either direction, so the situation is different.
Right click any column header and choose either "Sort Upstream->Downstream" or "Sort Downstream->Upstream".
Right click in the drawing plan view, choose "Edit Group", then double click the pipe table
Ensure that the Hydraulic grade (start) or Hydraulic Grade (stop) field is added to the table
Right click the HGL start or stop field and choose either Ascending or Descending, depending if you want to sort upstream or downstream. This of course assumes that you have at least some flow in the pipes you're sorting, so as to have a decrease in HGL as you move downstream.
If you want complete control over order, you could add a numeric User Data Extension field (Tools > User Data Extensions), add that column to your FlexTable, enter a value to specify the order for each row, then sort by that field.
If you need to label your elements based on a specific order, such as upstream-downstream or based on the connection order of each branch of a branched system, first use the above guidance to get your flextable sorted in the order that you want the elements labeled. Filter the table down if needed (based on selection set or query for example) if you only need to relabel certain elements.
Next, Right click the Label field's column header, choose Relabel, then choose Renumber as the Relabel Operation. Configure the prefix, suffix, etc and click OK.