1.table1:
([ID:`1`2`3]Name:`A`B`C;Client:`P`Q`S;ClientType:`QW`DS`WW;NameType:`jj`ll`oo;Basket:`QD`IO`LK;Sepal:5.1 4.5 23.5;Length:2 34 6;Species:`setosa`setosa`setosa)
2.write a simple function to select table1 data
api:{[Params]
if [Params~();Params:()!()];
defaultCols:`ID`Name`Client!(`ID`Name`Client);
if[`extraCols in key Params;
defaultCols:defaultCols,Params[`extraCols]!Params `extraCols];
: ?[ select from table1;();0b;defaultCols];
}
3.test api[(enlist[`extraCols]!enlist(`Species`Length))]
ID Name Client Species Length
1 A B setosa 2
2 B Q setosa 34
3 C S setosa 6
When I used one Params to test:api[(enlist[`extraCols]!enlist(`Species))]
But result type error.In my limited experience with this . Could you please help me understand this . thanks.
And i want to get below result and how to change my api
ID Name Client Species
1 A B setosa
2 B Q setosa
3 C S setosa