help using the left function

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

If(not IsNull([CUTSHEET_ID_OVERRIDE]),[CUTSHEET_ID_OVERRIDE],

[EWO_INFO]="GAIDA",Left([EWO_INFO], 9),Left([EWO_INFO],10))

Not sure why my Left function part of the formula not working

Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
what result are you getting and what result do you expect to get. Also, for an example record which has a problem, what data is in the fields for

[CUTSHEET_ID_OVERRIDE]
[EWO_INFO]
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
Cutsheet override is a text field, if the cutsheet ID is incorrect then use the override
EWO_INFO is a relationship field from a different table

If the Cutsheet ID is incorrect then use the override field
if the EWO = GAIDA the populate the first 9 of the field, otherwise use the first 10
For starters, whole not obvious, it is documented that the IsNull function does not work for text fields, so that is likely the problem.

Try this


If(Trim([CUTSHEET_ID_OVERRIDE])<>"", ,[CUTSHEET_ID_OVERRIDE],

[EWO_INFO]="GAIDA",Left([EWO_INFO], 9),Left([EWO_INFO],10))
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
Thanks, the IsNull was the problem
ya, it's just not obvious.  I forget off hand which way it works, but it will always return either true or false regardless of if there is data or not.  I think it's always false, ie it is never null even if it is empty.
Photo of QuickBasePros (Laura Thacker)

QuickBasePros (Laura Thacker), Champion

  • 6,396 Points 5k badge 2x thumb
This confuses me.

If(Trim([CUTSHEET_ID_OVERRIDE])<>"",[CUTSHEET_ID_OVERRIDE],

[EWO_INFO]="GAIDA",Left([EWO_INFO], 9),Left([EWO_INFO],10))


If EOW_INFO is equal to "GAIDA", then how can you show the left 9 characters or the left 10 characters?