Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am working with data on universities. I have two fields for university name linked by an ID tied to the name. One field is much longer and I would like to create one field for name where if there is a value in 'name 1' it takes that but if 'name 1' is empty it takes the value for 'name 2'
ID | Name 1 | Name 2 |
---|---|---|
1 | UNC | UNC |
2 | - | USC |
3 | UVA | - |
4 | - | UGA |
Any advice on how to write that to create a new field for name?
Thanks
Hi ,
LOAD ID,
[Name 1],
[Name 2],
if(len([Name 1])>1,[Name 1],[Name 2]) as [Final Name]
from file1
Thanks
BKC
Hi,
in your load data
..
if(Name1='',Name2,Name1) as Name
HTH
André Gomes
hi,
try like
if(isnull(Name 1) or len(trim(Name 1))=0,Name 2,Name 1) as Name
Regards
Something like:
Load....
....
if(len(Name1)>0,Name1,Name2) as Name
......
from....
Hi ,
LOAD ID,
[Name 1],
[Name 2],
if(len([Name 1])>1,[Name 1],[Name 2]) as [Final Name]
from file1
Thanks
BKC
Hope the attached qvw solves your problem
How can we do the same but if the fields are in different tables?
Hello,
if (Len([Name_1])>1,
[Name_1],
[Name_2]) as [UniversityName]
Zain.