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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
tripatirao
Creator II
Creator II

Replacing null value

Hi all

I want to replace Brandname  as OtherBrand where Brandname is null .

I want to do  this  in the script.

for exemple:

Brandname  ,Sales

abc,1000

pqr,2000

-,2500

xyz,1500

when the scrpt will load my Brandname dimension should be like below.

Brandname

abc,

pqr,

OtherBrand,

xyz

Thanks in advance....

1 Solution

Accepted Solutions
ManuelRühl
Partner - Specialist
Partner - Specialist

if(isnull(Brandname),'OtherBrand',Brandname) as Brandname,

or

if(len(Brandname)>0,Brandname,'OtherBrand') as Brandname,

Manuel Rühl

View solution in original post

14 Replies
ManuelRühl
Partner - Specialist
Partner - Specialist

if(isnull(Brandname),'OtherBrand',Brandname) as Brandname,

or

if(len(Brandname)>0,Brandname,'OtherBrand') as Brandname,

Manuel Rühl
tripatirao
Creator II
Creator II
Author

Hi

I tried this but it is not working for me.

ManuelRühl
Partner - Specialist
Partner - Specialist

is it really null() or is there anything in the field ?

Manuel Rühl
gautik92
Specialist III
Specialist III

if(IsNull( Brand ),'OtherBrand',Brand)

this syntax is working fine for me

pamaxeed
Partner - Creator III
Partner - Creator III

you have there a null value or an empty string or '-' ?
It is depending on it....

prma7799
Master III
Master III

Please try this.

ABC:

LOAD *,

if(Brandname ='-','OtherBrand',Brandname)as Brandname1;

LOAD * Inline

[

Brandname  ,Sales

abc,1000

pqr,2000

-,2500

xyz,1500

];

Thanks

gautik92
Specialist III
Specialist III

try qlikview7799 suggestion it will work for sure

maxgro
MVP
MVP

where do you get null for BrandName?

in a table? Brandname and Sales are fields of the same table?

in a chart?

tripatirao
Creator II
Creator II
Author

in straight table  the null value is replaced by OtherBrand in following way by taking

calculated dimesion :if(len(trim(BrandName))=0,'OtherBrand',BrandName)

expression:sum(Sales)


But when i am doing in script  blank space is showing.