When converting a missing Numeric value to Char, Char() will return ".". Is there a simple way to return ""?
(I know I can wrap with If( Is Missing( )), but this seems unnecessarily cumbersome.
New Table( "Missing Numeric to Char",
Add Rows( 1 ),
New Column( "Numeric", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [.] ) ),
New Column( "Is Numeric Missing?", Numeric, "Continuous", Format( "Best", 12 ), Formula( Is Missing( :Numeric ) ) ),
New Column( "Char", Character, "Nominal", Formula( Char( :Numeric ) ) ),
New Column( "Is Char Missing?", Numeric, "Continuous", Format( "Best", 12 ), Formula( Is Missing( :Char ) ) ),
New Column( "Really cumbersome method", Character, "Nominal", Formula( If( Is Missing( :Numeric ), "", Char( :Numeric ) ) ) ),
New Column( "Is Really cumbersome method missing?",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Is Missing( :Really cumbersome method ) )
)
);
I think easiest is to just use If + Is Missing. Using the that like you do is better (easier to understand), but you can also leave the "" out
If(!IsMissing(:numeric), Char(:numeric))
And if you don't need a formula, just change the data type.
Thanks. Not as elegant as I hoped, but it works.