There are two ways to automatically rearrange the order of lines in Calculations. Firstly, you can click on the name of a column in the header at the top of CET Designer, go through the Sorting tab in View Settings.
Click on the name of the Column header to sort alphanumerically; if you click again it will do a reverse sort so that the lines are listed in a descending order (Z-A/9-0). A black triangle pointing up or down will denote if the column is being sorted in an ascending or descending manner. Select a second header and it will be the second sort column. The number shown represents the priority of sorting.
The other way to Sort is in View Settings:
In View Settings, go to the Sorting tab.
In the Sort by column, check any properties by which you would like to sort your lines. You can sort by as many or as few properties as you need. In the column with the triangle at the top, you can click the arrows that appear in each row that is turned on to toggle between ascending (A-Z) and descending (Z-A) order. Select a line that is turned on and use the green arrows to the left to re-arrange the order of the lines. The lines are numbered to show the priority of that particular property being sorted.
From the Sorting tab in View Settings dialog, you can also decide to enable the Manual sort column, to be able to move the rows in your calculation.