IN function

  • 21 December 2021
  • 0 replies
  • 633 views

Userlevel 4
Badge +6
  • Community Manager
  • 20 replies

 

Description

Checks a List to see if items are part of that List or if items fall within a defined range in that List, then returns a true or false value.

 

Syntax

For specific items

List IN (List."Item1", List."Item2",..., List."ItemN")

 

When using specific items, or referencing a Metric with one specific item, use a , to separate the different values. Must have at least 1 value but can contain multiple different values. 

 

For ranges

List IN (souce_block_lower : souce_block_upper)

When using a range, use : to separate the lower value and the upper value (inclusive values).  souce_block can be a List property or Metric that is Date, Number, or Integer formatted.

 

Return type

Boolean (True or False)

 

Examples

Case

Results

Return Type

Country IN (Country."France", Country."UK")

returns TRUE for the 2 countries listed, FALSE for the others

boolean

NOT Month IN (Month."Jan 22", Month."Feb 22", Month."Mar 22")

returns FALSE for the months listed, TRUE for the others

boolean

'Switchover date' [Add: Year] IN (Year.'Start Date': Year.'End Date') returns True for the year that the Switchover date is within the range of the Start Date and End Date of that Year. boolean

 

Excel equivalent: none

See also: NOT


This topic has been closed for comments