Hi,
I have an original set of data (table1), and I am trying to script it to the result in table 2.
If any number that is below 300, will print "type1" string into "result1" column.
If any number is above 300, will print "type2" string into "result2" column.
| Number | type1 | type2 | result1 | result2 |
| 100 | a1 | a2 | | |
| 200 | b1 | b2 | | |
| 150 | c1 | c2 | | |
| 275 | d1 | d2 | | |
| 555 | e1 | e2 | | |
| 424 | f1 | f2 | | |
| 572 | g1 | g2 | | |
| 783 | h1 | h2 | | |
| 125 | i1 | i2 | | |
Table1: Original data
| Number | type1 | type2 | result1 | result2 |
| 100 | a1 | a2 | a1 | |
| 200 | b1 | b2 | b1 | |
| 150 | c1 | c2 | c1 | |
| 275 | d1 | d2 | d1 | |
| 555 | e1 | e2 | | e2 |
| 424 | f1 | f2 | | f2 |
| 572 | g1 | g2 | | g2 |
| 783 | h1 | h2 | | h2 |
| 125 | i1 | i2 | i1 | |
Table2: Result
So far, what i have done on my script is shown below.
dt = current data table(); dt << new column( "result1", Character, "Nominal", For each row(If (:Number << 300), :result1 == :type1, "") );<BR /><BR />dt << new column( "result2", Character, "Nominal", For each row(If (:Number >> 300), :result2 == :type2, "") );