Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to step through some values and have them loaded as a new field to be used in an aggregation calculation:
I want a new field called StrikePrice to be populated with values 10-20, and have some calculated fields generated from it...
I am not having any luck so far with it...any ideas?
for strike=10 to 20
let $(strikeprice)=strike;
Concatenate LOAD Name1,Year,Month,Day,HE,
$(strikeprice) as StrikePrice,
avg(TotalLMP_DA)-avg(TotalLMP_RT) as DART_LMP_DELTA,
nummax(0,($(strikeprice)-avg([TotalLMP_DA]))/fabs($(strikeprice)-avg([TotalLMP_DA])))*(avg([TotalLMP_DA])-avg([TotalLMP_RT])) as DemandPL,
nummax(0,-1*($(strikeprice)-avg([TotalLMP_DA]))/fabs($(strikeprice)-avg([TotalLMP_DA])))*(avg([TotalLMP_RT])-avg([TotalLMP_DA])) as SupplyPL
RESIDENT Data
GROUP BY Name1,Year,Month,Day,HE
;
next strike;
Something along these lines (while loop instead of for loop):
LOAD Name1,Year,Month,Day,HE,iterno()+10 as StrikePrice
...
RESIDENT Data
GROUP BY Name1,Year,Month,Day,HE
WHILE iterno()<=11
;
Something along these lines (while loop instead of for loop):
LOAD Name1,Year,Month,Day,HE,iterno()+10 as StrikePrice
...
RESIDENT Data
GROUP BY Name1,Year,Month,Day,HE
WHILE iterno()<=11
;
Thanks John - this is just what I needed!