Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

expr

Hi All,

Hi in the script level iam trying to replace the null va;ues in Dept by brand , can anyone suggest if below statement is correct ?

if(IsNull(Dept),'brand',Dept),

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

if(IsNull(Dept),'brand',Dept) as Fieldname


Or, better to deal with not-null spaces or other invisible characters try like:


if(Len(Trim(Dept))=0,'brand',Dept) as Fieldname


Assuming Dept is a field and you want it's value to be called as 'brand'.

View solution in original post

9 Replies
tresesco
MVP
MVP

Try like:

if(IsNull(Dept),'brand',Dept) as Fieldname


Or, better to deal with not-null spaces or other invisible characters try like:


if(Len(Trim(Dept))=0,'brand',Dept) as Fieldname


Assuming Dept is a field and you want it's value to be called as 'brand'.

smilingjohn
Specialist
Specialist
Author

Yes Dept is a field and when ever there is null value in Dept it should be named as brand, if no null then as it is .

tresesco
MVP
MVP

Have you tried the above solutions?

nitin_01
Creator
Creator

Hi Tresesco,

            if(Len(Trim(Dept))>0,'brand',Dept) as Fieldname


with all respect, i'am perplexed with above condition that would give a desired output.


That shud be '=0' or '>0' ?


Regards,

Nitin.


tresesco
MVP
MVP

You are spot on. Corrected my post above.

nitin_01
Creator
Creator

hahah...

we follow you..:)

Regards,

Nitin.

aapurva09
Creator
Creator

Hi,

try this:

if(len(Dept)<=0,'brand',Dept)

Thanks

Not applicable

Try this    If(len(Dept)=0,Brand,Dept) as NewField,

Let me know if this is working else I will provide other solution.

Thanks

jaydeep

smilingjohn
Specialist
Specialist
Author

Hi tressco

you first statement worked fine

if(IsNull(Dept),'brand',Dept) as Fieldname