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 ) )
)
);
제 생각엔 그냥 "If + Is Missing"을 사용하는 게 가장 쉬울 것 같아요. 지금처럼 사용하는 게 더 좋고 (이해하기 쉽죠), 하지만 ""를 생략해도 됩니다.
If(!IsMissing(:numeric), Char(:numeric))
수식이 필요하지 않다면 데이터 형식을 변경하기만 하면 됩니다.
감사합니다. 기대했던 만큼 세련되지는 않지만, 작동은 잘 되네요.