duplicated if and ternary for etSales to provide a better loop.