User Tools

Site Tools


howtos:toolcoding:many_to_one_mapping_with_non_summation_aggregation_rule

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
howtos:toolcoding:many_to_one_mapping_with_non_summation_aggregation_rule [2010/04/23 18:34]
deryn.crockett
howtos:toolcoding:many_to_one_mapping_with_non_summation_aggregation_rule [2010/04/23 18:39]
deryn.crockett
Line 32: Line 32:
  
 ===== Implementation ===== ===== Implementation =====
-  - Create the following desired mapping from unitID to plantID is:\\+1. Create the following desired mapping from unitID to plantID is:\\
  
 Unit1 -> Plant1\\ Unit1 -> Plant1\\
Line 44: Line 44:
 </​code>​ </​code>​
  
-  - Create a mask that will expand unitComYr to include plantID+ 
 +2. Create a mask that will expand unitComYr to include plantID
  
 <​code>​ <​code>​
Line 57: Line 58:
 {{:​howtos:​toolcoding:​unitcomyrx.png|}} {{:​howtos:​toolcoding:​unitcomyrx.png|}}
  
 +
 +3. Add offset to remove 0's before taking minimum
 <​code>​ <​code>​
-! add offset to remove 0's before taking minimum 
 local unitComYry[uid,​pid] = booleq (unitComYrx[uid,​pid],​0) * 9999 + unitComYrx[uid,​pid] local unitComYry[uid,​pid] = booleq (unitComYrx[uid,​pid],​0) * 9999 + unitComYrx[uid,​pid]
 +</​code>​
  
-! variable that contains online date, which is the earliest commissioning year of the units that comprise the plant, by plant id 
-local plantOnlineDate[pid] = coordmin (reorder (unitComYry[uid,​pid];​ plantID, unitID); numDims=1) 
-table (plantOnlineDate[pid]) 
  
 +4. Use coordmin to create a variable that contains online date, which is the earliest commissioning year of the units that comprise the plant, by plantId
 +<​code>​
 +local plantOnlineDate[pid] = coordmin (reorder (unitComYry[uid,​pid];​ plantID, unitID); numDims=1)
 </​code>​ </​code>​
 +{{:​howtos:​toolcoding:​plantonlinedate.png|}}
 +
howtos/toolcoding/many_to_one_mapping_with_non_summation_aggregation_rule.txt · Last modified: 2011/06/13 16:20 by chris.strashok