/    /  Amazon QuickSight – endsWith

Amazon QuickSight – endsWith

 

The endsWith function in Amazon QuickSight determines whether a given expression ends with a specified substring. The function takes two required arguments, which are the input expression that you want to check, and the substring that you want to search for, as well as an optional third argument that specifies the comparison mode.

Syntax

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

 

This function takes three arguments

 

  • Expression: parameter is the input expression that you want to check.
  • Substring: parameter is the substring that you want to search for.
  • string-comparison-mode: parameter is an optional argument that specifies how the comparison between the input expression 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 expression and the substring.
  • CASE_INSENSITIVE: This mode performs a case-insensitive comparison between the input expression and the substring.
  • ACCENT_INSENSITIVE: This mode performs a comparison between the input expression and the substring that is both case-insensitive and accent-insensitive. It treats accented and unaccented characters as equivalent.

For example, if you have a data set that includes a column for email addresses and you want to filter the data to only include email addresses that end with the substring “@example.com”, you can use the endsWith function with the CASE_INSENSITIVE mode to create a filter expression.

Example

#Start#
endsWith(EmailAddress, "@example.com", "CASE_INSENSITIVE")
#End#

 

This filter expression would return true for all email addresses that end with the substring “@example.com” regardless of the case of the letters.