What is the error?
Ans. The erroe it shows while reload in Script as Invalid Expression.
What else have you tried?
Ans. Now i have made it like this
LOAD NCCargoRisk.NumberOfDays as TotNrOfDays_CargoRisk,
NCCargoRisk.ID as MTMID_CargoRisk,
NCCargoRisk.ID as NCCargoRisk_Link_CargoRiskResident,
NCCargoRisk.TCEQSECONDLEG as TCEQSecondLeg_CargoRisk,
NCCargoRisk.SECONDLEGPRICE as SecondLegPrice_CargoRisk,
NCCargoRisk.CARGONAME as CargoName_CargoRisk,
Date(NCCargoRisk.STARTDATE,'$(DateFormat)') as StartDate_CargoRisk,
Date(NCCargoRisk.ENDDATE,'$(DateFormat)') as EndDate_CargoRisk,
NCCargoRisk.QUANTITY as Qty_CargoRisk,
NCCargoRisk.DURATIONSECONDLEG as DurationSecondLeg_CargoRisk,
NCCargoRisk.FREIGHTRATE as FreightRate_CargoRisk,
Date(NCCargoRisk.PRICEDATE,'$(DateFormat)') as PriceDate_CargoRisk,
NCCargoRisk.IFOPRICE as IFOPrice_CargoRisk,
-(NCCargoRisk.Duration_Risk) as ExposureDuration_CargoRisk,
NCCargoRisk.MarketValue_Risk as MarketValue_CargoRisk
FROM [$(QVDPATHTRANS)NCCargoRisk.qvd] (qvd);
Load Max(PriceDate_CargoRisk,'$(DateFormat)') as PriceDate_CargoRisk1 resident NCCargoRisk;
PriceDate_CargoRisk as PriceDate_CargoRisk_Resident,
//MaxString(PriceDate_CargoRisk) as Max_PriceDate,
if(PriceDate_CargoRisk = PriceDate_CargoRisk1,ExposureDuration_CargoRisk) as TD_ExposureDuration_CargoRisk,
ExposureDuration_CargoRisk as ED_CargoRisk_Today
Its Working Fine now
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
left join Load date(Max(PriceDate_CargoRisk),'$(DateFormat)') as PriceDate_CargoRisk1 resident NCCargoRisk
This will add PriceDate_CargoRisk1 field for every line in table NCCargoRisk