I have a table similar to this:
x | y | z | xyz | xyz | ||
aa | 1 | 2 | . | 3 | ||
bb | . | . | ||||
cc | 2 | 3 | . | 5 |
The columns have rows containing both numeric and empty data.
I want to create a new column (xyz) where I add the data in column x, y and z.
In other words, I want the result to look like the green xyz-column.
The problem is, when I run my script, I get the result in the red xyz-column..
How do I add columns with empty data?
I use the following script to create the xyz-column:
dt << New Column("xyz",
Numeric,
Formula(:Name("x")+:Name("y")+:Name("z")
)
);
1 个已接受解答
已接受的解答
已创建:
May 8, 2017 08:18 AM
| 上次修改时间: May 8, 2017 5:19 AM
(7355 浏览量)
| Posted in reply to message from sirihofstadtrap 05-08-2017
Use:
dt << New Column( "xyz", Numeric, Formula( Sum( :x, :y,:z ) ) );
The Sum() function ignores missing values.
Jim
2 条回复2
已创建:
May 8, 2017 08:18 AM
| 上次修改时间: May 8, 2017 5:19 AM
(7356 浏览量)
| Posted in reply to message from sirihofstadtrap 05-08-2017
Use:
dt << New Column( "xyz", Numeric, Formula( Sum( :x, :y,:z ) ) );
The Sum() function ignores missing values.
Jim