Returns the maximum numeric value of expression encountered over a number of records as defined by a group by clause. Rank defaults to 1 which corresponds to the highest value. By specifying rank as 2 the second highest value will be returned. If rank is 3 the third highest value will be returned and so on.
Load Month, max(Sales) as LargestSalePerMonth from abc.csv group by Month;
Load Month, max(Sales, 2) as SecondLargestSalePerMonth from abc.csv group by Month;
I down totally understand your idea but try this
Load date(Max(PriceDate_CargoRisk),'$(DateFormat)') as PriceDate_CargoRisk1
This will add PriceDate_CargoRisk1 field for every line in table NCCargoRisk