Target structure is very similar however I need to output the parameters sorted by Name and by ValidTo ascending. As shown in the above example, ValidTo is sometimes blank which signifies it is valid indefinitely therefore should be last in the sorted list. If I sort the source ascending, the blanks appear first. How can I sort by name and validto with these blanks appearing in the correct place OR alternatively, how I can modify the source validTo to put in a dummy date e.g 9999-12-31 before the sort (consequently the sort will work as expected)?