IIF - spectrum_spatial - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-03-07
ft:lastPublication
2025-03-07T10:28:48.112000

Description

Returns the value from true_expression or false_expression based on a condition.

Returns the value from the true_expression if boolean_expression returns true, or returns the value from the false_expression if boolean_expression returns false. The true_expression and the false_expression must return the same type.

Syntax

IIF (boolean_expression, true_expression, false_expression )

Arguments

boolean_expression is a condition expression that returns a boolean value. If null is returned, it is treated as false.

true_expression is an expression, its value will be returned when the value of boolean_expression is true.

false_expression is an expression, its value will be returned when the value of boolean_expression is false.

Examples

Returns the size of a country based on the population.
SELECT Country, IIF ( (Pop_1994 > 100000000), 'Large', IIF ( (Pop_1994 < 10000000), 'Small', 'Medium') ) 
AS Size from "/Samples/NamedTables/WorldTable" WHERE country in ('Canada','Vietnam','Brazil','China','Japan')