Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 tripatirao
		
			tripatirao
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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....
 ManuelRühl
		
			ManuelRühl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if(isnull(Brandname),'OtherBrand',Brandname) as Brandname,
or
if(len(Brandname)>0,Brandname,'OtherBrand') as Brandname,
 ManuelRühl
		
			ManuelRühl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if(isnull(Brandname),'OtherBrand',Brandname) as Brandname,
or
if(len(Brandname)>0,Brandname,'OtherBrand') as Brandname,
 
					
				
		
 tripatirao
		
			tripatirao
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
I tried this but it is not working for me.
 ManuelRühl
		
			ManuelRühl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		is it really null() or is there anything in the field ?
 
					
				
		
 gautik92
		
			gautik92
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if(IsNull( Brand ),'OtherBrand',Brand)
this syntax is working fine for me
 
					
				
		
 pamaxeed
		
			pamaxeed
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		you have there a null value or an empty string or '-' ?
It is depending on it....
 prma7799
		
			prma7799
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Please try this.
ABC:
LOAD *,
if(Brandname ='-','OtherBrand',Brandname)as Brandname1;
LOAD * Inline
[
Brandname ,Sales
abc,1000
pqr,2000
-,2500
xyz,1500
];
Thanks
 
					
				
		
 gautik92
		
			gautik92
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try qlikview7799 suggestion it will work for sure
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		where do you get null for BrandName?
in a table? Brandname and Sales are fields of the same table?
in a chart?
 
					
				
		
 tripatirao
		
			tripatirao
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 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.
