Subscribe Bookmark RSS Feed

I am attempting to script a new column with conditional formula. The column is created but it empty. Any ideas?

james_dale

Community Member

Joined:

Feb 6, 2016

jt1 << New Column( "Camera Status",

Character,

Nominal,

Formula(If (CameraStatusType_ID)= 1, "Pass", "Fail"),

);

1 REPLY
Craige_Hales

Staff

Joined:

Mar 21, 2013

use == to test for equality, and think of IF as a function with arguments: if( expression that is true or false, do this if true, do this if false );

In this example, "do this" returns a string for the result of the if-function.

10920_Capture.PNG

New Table( "Untitled",

  Add Rows( 2 ),

  New Column( "Column 1",

  Numeric,

  "Continuous",

  Format( "Best", 12 ),

  Set Values( [1, 0] )

  ),

  New Column( "Column 2",

  Character,

  "Nominal",

  Formula( If( :Column 1 == 1, "Pass", "Fail" ) ),

  Set Selected

  )

)

Craige