Search code examples
left-joinspotfire

LEFT function usage in spotfire


Below formula is not working. Does anyone know the reason.

Left([Week],4)

is not working?

Week is column name


Solution

  • If you want the LEFT most 4 characters use LEFT(). If you want the RIGHT, aka LAST 4 characters use RIGHT()

    RIGHT('201234',4) will return 1234
    LEFT('201234',4) will return 2012
    

    This can be used in a calculated column or anywhere else on a STRING. If your column is an Integer or Decimal or anything else you need to cast it.

    RIGHT(String([Week]),4) will return 1234 when the value is 201234 
    LEFT(String([Week]),4) will return 2012 when the value is 201234