Custom Column: Conditional Column Value Based on Landings

From ZuluLog Wiki
Jump to: navigation, search

In this example, we will create a column that displays one of three values:


Creating the definition

1. Go to the Custom Report Setup for Flight Viewer screen.
2. Enter a name for this setup. Later, on the Flight Viewer, you'll be able to select this name from the drop-down list.
3. For your Day Sim Inst column, select "[Custom Column]" under Column Contents. The label and expression fields will then appear.
4. Under Custom Column Label, enter a name for this column. This will be displayed as the column header on the flight viewer.
5. Under Custom Column Definition / Expression, enter:
if (getfieldnum("Night Full Stop") >= 3) 
        col_value = "Night Currency";  
      else 
      { 
        var nn = getfieldnum("Day Full Stop") +  
                 getfieldnum("Night Full Stop") +  
                 getfieldnum("Day Touch/Go") +  
                 getfieldnum("Night Touch/Go"); 
        if (nn >= 3) 
          col_value = "Day Currency"; 
        else 
          col_value = " "; 
     }


6. Select any other columns you'd like to see on this view, and click "Save Setup".


How it works

The predefined variable col_value determines what is displayed in this column. If this flight has three or more night full stop landings, we set col_value to "Night Currency". Otherwise, we total up all full stop and touch/go landings for this flight. If this total is greater than or equal to three, we set col_value to "Day Currency". Otherwise, we set col_value to a blank space.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox