/    /  Amazon QuickSight – contains

Amazon QuickSight – contains

 

The “contains” function in QuickSight is used to check whether a string contains a specific substring. It is often used in data analysis and reporting to filter and group data based on specific criteria.

Syntax

#Start#
contains(expression, substring, string-comparison-mode)
#End#

 

This function takes three arguments

 

  • Expression: parameter is the input string that you want to search in.
  • Substring: parameter is the string that you want to search for.
  • string-comparison-mode : parameter is an optional argument that specifies how the comparison between the input string and the substring should be performed. 

 

The string-comparison-mode parameter can take one of three values:

  • CASE_SENSITIVE: This is the default mode. It performs a case-sensitive comparison between the input string and the substring.
  • CASE_INSENSITIVE: This mode performs a case-insensitive comparison between the input string and the substring.
  • ACCENT_INSENSITIVE: This mode performs a comparison between the input string and the substring that is both case-insensitive and accent-insensitive. It treats accented and unaccented characters as equivalent.

Example

#Start#
contains(CustomerName, "Jones", "CASE_INSENSITIVE")
#End#

 

This filter expression would return true for all customers whose name contains the substring “Jones” regardless of the case of the letters.