Hello,
I'm trying to build a quick query in which a categorical column (test_article) is used to create a series of column which contains only a subset of the information. If the script works as intended, the table would end up with 2 new columns (PBS vs ...).
| test_article | measurement | PBS vs 709547 | PBS vs 709139 |
| PBS | 1.23 | PBS | PBS |
| PBS | 1.456 | PBS | PBS |
| 709547 | 4.56 | 709547 | EXCLUDE |
709139 | 5.02 | EXCLUDE | 709139 |
| 709139 | 6.02 | EXCLUDE | 709139 |
| 709547 | 4.57 | 709547 | EXCLUDE |
I've tried the following script:
NamesDefaultToHere(1);
dt=current data table();
row = Associative Array( :test_article ) << Get Keys;
nc=N items (row);
For( i = 1, i <= nc, i++,
new column("PBS vs "|| row[i],"Character", "Nominal", Formula(If( :test_article == "PBS", :test_article,
If( :test_article == row[i],
"test",
"EXCLUDE"
)
))));Somehow, it does not populate any values in the new columns with the exception of 'PBS'.
Any suggestions?
Thanks a lot
Sebastien