# contextSum2 {#contextsum2}

## Syntax {#syntax}

`contextSum2(X, Y)`

## Arguments {#arguments}

**X** and **Y** are vectors, matrices or tables.

## Details {#details}

Get of positions that are not null in both *X* and *Y*, and calculate the sum of squares of the elements in *X* on these positions.

**Return Value**: DOUBLE type \(regardless of the data types of *X* and *Y*\)

## Examples {#examples}

```
contextSum2(1 2 3, 10 NULL 30);
// output: 10

contextSum2(1 2 3, true false true);
// output: 14
```

Related functions: [contextCount](contextCount.md), [contextSum](contextSum.md)

