| Quintiq file version 2.0 | 
| #parent: #root | 
| Function CalcY | 
| { | 
|   TextBody: | 
|   [* | 
|     //Only set the Y pos for the weights that are added to strategy level | 
|      | 
|     value := 0; | 
|     if( not isnull( this.StrategyLevel() ) ) | 
|     {           | 
|       value := 20; | 
|       prevweight := this.PreviousKPIWeightInLevel(); | 
|       //Previous weight in the same level | 
|       if( not isnull( prevweight ) ) | 
|       {        | 
|         value := prevweight.Y() + 20; | 
|       } | 
|       else | 
|       { | 
|         prevlvl := this.StrategyLevel().Previous(); | 
|         if( not isnull( prevlvl ) and prevlvl.Level() > 0 ) | 
|         { | 
|           value := guard( prevlvl.Last().Y(),0) + 20 + 20; //on different level, we add some gaps | 
|         } | 
|       } | 
|     } | 
|      | 
|     this.Y( value ); | 
|   *] | 
| } |