Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replace with IsNull or ''

I am currently concatenating two fields and adding a space

trim([Opportunity owner Firstname]& '  ' &[Opportunity owner Surname]) as [Opportunity Owner],

I'd also like to if either the Firstname or Surname is '' or Null to null the [Opportunity Owner],

Could someone point me in the right direction please?

1 Solution

Accepted Solutions
Not applicable
Author

Hi Lewis,

try with this:

if (IsNull([Opportunity owner Firstname]) or trim([Opportunity owner Firstname])='' or IsNull([Opportunity owner Surname]) or trim([Opportunity owner Surname])='' , null(), trim([Opportunity owner Firstname]) & ' ' & trim([Opportunity owner Surname])) as [Opportunity Owner]

View solution in original post

6 Replies
SunilChauhan
Champion II
Champion II

(

if(isnull([Opportunity owner FisrtName]),' ',[Opportunity owner FisrtName])

& '  ' &

if(isnull([Opportunity owner Surname]),' ',[Opportunity owner Surname]))

you can also change ' ' to any thing else like  'NULL'

hope this helps

Sunil Chauhan
Not applicable
Author

Will this remove the space i have added in the concatenate?

SunilChauhan
Champion II
Champion II

in that case use below code

trim(

if(isnull([Opportunity owner FisrtName]),' ',[Opportunity owner FisrtName])

&

if(isnull([Opportunity owner Surname]),' ',[Opportunity owner Surname]))

Sunil Chauhan
jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

Try this code. Hope it helps you.

If([Opportunity owner Firstname]& '  ' &[Opportunity owner Surname]='',Null(),Trim([Opportunity owner Firstname]& '  ' &[Opportunity owner Surname])) as [Opportunity Owner]

Not applicable
Author

Hi Lewis,

try with this:

if (IsNull([Opportunity owner Firstname]) or trim([Opportunity owner Firstname])='' or IsNull([Opportunity owner Surname]) or trim([Opportunity owner Surname])='' , null(), trim([Opportunity owner Firstname]) & ' ' & trim([Opportunity owner Surname])) as [Opportunity Owner]

Not applicable
Author

Excellent, thats worked perfectly... Thank you all for your help!