4.17 and - Logical Conjunction

Format: and($bool_1,bool_2,\cdots $)

Calculate the logical conjunction of boolean value $bool_ i$. Please refer to Table 4.8 on boolean value table with NULL values.

Example

Example 1: Basic Example

$ more dat1.csv
id,b1,b2,b3
1,1,0,1
2,1,1,1
3,1,,1
4,1,1,1
$ mcal c='and($b{b1},$b{b2},$b{b3})' a=rsl i=dat1.csv o=rsl1.csv
#END# kgcal a=rsl c=and($b{b1},$b{b2},$b{b3}) i=dat1.csv o=rsl1.csv
$ more rsl1.csv
id,b1,b2,b3,rsl
1,1,0,1,0
2,1,1,1,1
3,1,,1,
4,1,1,1,1

Example 2: Example of using wildcard

Specify columns names that start with b as in (b1,b2,b3) using a wildcard in column name such as "b*".

$ mcal c='and($b{b*})' a=rsl i=dat1.csv o=rsl2.csv
#END# kgcal a=rsl c=and($b{b*}) i=dat1.csv o=rsl2.csv
$ more rsl2.csv
id,b1,b2,b3,rsl
1,1,0,1,0
2,1,1,1,1
3,1,,1,
4,1,1,1,1