Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
hi guys,
need assistance on this scenario,
data is like this:
Column1:
asdf1234-1
dfgf2345-11
gdd4567cc-1
ghj4563ccc-12
aser8762-213
expected output:
Column1,OutPut
asdf1234-1,1
dfgf2345-11,0
gdd4567cc-1,1
ghj4563ccc-12,0
aser8762-213,0
Note for output: If we have only "1" after "-" display as 1 else 0.
I tried with mid(),not success-ed completely.
thanks in advance.
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try this:
Table:
LOAD *,
If(SubField(Column1, '-', 2) = 1, 1, 0) as Output;
LOAD * Inline [
Column1
asdf1234-1
dfgf2345-11
gdd4567cc-1
ghj4563ccc-12
aser8762-213
];
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		another
Table:
LOAD *,
if( right(Column1,2)='-1',1,0) as Output;
LOAD * Inline [
Column1
asdf1234-1
dfgf2345-11
gdd4567cc-1
ghj4563ccc-12
aser8762-213
];

