I have a list of names of which some contain (
I am using the code below to take the values prior to the ( which works great.
left(a.name, index(a.name,'(') -1) as [Name]
However, the values without any ( aren't returned. What's the best way to add them in?
you should use an if()-statement similar to this:
Load . . .
If( index(a.name,'(')) > 0, left(a.name, index(a.name,'(') -1), a.name) AS Name,
. . .
Cheers Ronald, works great
please upload ur file
Try the following script, it works for me.
SubField(a.Name,'(',1) as Name
Krishnamoorthy, also works great.
For some reason, I couldn't mark yours as correct as well. Maybe as I'd already marked Ronald's as correct.
You can try to use subfield instead of your expression:
=SubField(a.name, '(', 1)
It will return everything if it doesn't find the bracket
Retrieving data ...