I built a table selector that can produce many tables from a master table by filtering on a specific column that I desire with the required values. The formula is as below:
fn:{[tabl;colm;fltr]
wc: {(in;x;enlist y)}.'flip(colm;fltr);
res: ?[tabl;wc;0b;()];
b: (enlist `sym)!enlist `sym;
c: (`requests`deals`users)!((count;`rq);(count;(?;(=;`status;enlist`Done);`rq;0));(count;(?;`active;`rq;0)));
?[res;();b;c]
};
I would like the columns of the table, i.e. 'requests'deals'users
, to be dynamic based on the value inputted into the function through variable fltr
. So if I ran the below line:
fn[tabl;enlist 'Method;enlist 'Electronic];
Then this would filter the master table and return a table with three columns that have the following names: 'requestsElectronic'dealsElectronic'usersElectronic
.
I have attempted different variations of string
and sv
with iterators and keep receiving a mismatched types
error.
Any help would be greatly appreciated!