Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | table | |
Tool | table |
expr | in | Expression string | |
Allowed: | String |
t:=table("3C273XC1.MS"); t.calc ('DATA+1');returns a (potentially enormous) record where a field contains the value of the expression for the row with that number. Note that it returns a record because for each row the expression results in an array. It should be clear that this example is useless. However, something like this could be useful for a column with (very) small arrays.
t:=table("3C273XC1.MS"); t.calc ('ntrue(FLAG)');returns for each row the number of flags set. The result is a vector, because for each row the expression results in a scalar.
t:=table("3C273XC1.MS"); t.calc ('sum([select from $1 giving [ntrue(FLAG)]])');returns the total number of flags set in the table (in a single scalar). It is the same as
sum(t.calc ('ntrue(FLAG)'));The latter is easier to write, but sends (much) more data over the glish bus.