Hello, I have the following code: I want the new columns generated inside the dt will be as a numeric&continuous so I can force on the data some variabilty charts and other things. But after running the script the data is still remains as Character & Nominal
<BR />
dt = New Table( "myExample2",
Add Rows( 3 ),
New Column( "Column 1",
Numeric,
Continuous,
Format( "Best", 8 ),
Set Selected,
Set Values( [2, 5, 8] )
),
New Column( "Column 2",
Character,
Nominal,
Set Values( {"5|6|5", "5|6|5", "5|6|5"} )
),
Set Row States( [0, 0, 1] )
);
For( i = 1, i<= 3, i++,
dt << New Column ("C" || char(i),
Numeric,
Continuous,
Formula(
Word( i, As Column( Column( "Column 2" ) ), "|" )
)
)
);First, you can use the name directly, :Column 2, without the As Column() directive.
Second, put the Word() function inside the Num() function to convert the value to a number.