> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RS_LogicalDifference

Return value from band 1 if a value in band1 and band2 are different, else return 0

## Signatures

```sql theme={"system"}
RS_LogicalDifference (Band1: ARRAY[Double], Band2: ARRAY[Double])
```

## Parameters

<ParamField body="Band1" type="ARRAY[Double]" required>
  The first spectral band.
</ParamField>

<ParamField body="Band2" type="ARRAY[Double]" required>
  The second spectral band.
</ParamField>

## Return type

<ResponseField type="Array<Double>">
  An array of double values.
</ResponseField>

## Example

```scala theme={"system"}
val logicalDifference = spark.sql("select RS_LogicalDifference(band1, band2) as logdifference from dataframe")
```
