Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 yura_ratu
		
			yura_ratu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi all,
I load new data every day and need not just concatenate it to previous one, but also make changes in old data according to a new data. Here is an example of tables
load * Inline [
a, b
1,2
2,3
3,8
];
load * Inline [
a, b
1,5
2,3
4,3
5,4
];
As a result of joining/concatenating them I would like to have
a, b
1,5
2,3
3,8
4,3
5,4
How can I do that?
 
					
				
		
 nagaiank
		
			nagaiank
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try loading in the following order:
load * Inline [
a, b
1,5
2,3
4,3
5,4
];
Concatenate
load * Inline [
a, b
1,2
2,3
3,8
]
where not exists(a);
 
					
				
		
 alexandros17
		
			alexandros17
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Here it is:
A:
NoConcatenate
load * Inline [
a, b
1,2
2,3
3,8
];
B:
NoConcatenate
load * Inline [
a, b
1,5
2,3
4,3
5,4
];
AB:
NoConcatenate
LOAD * Resident A;
Concatenate
LOAD * Resident B;
DROP Tables A, B;
Left Join
LOAD a, Max(b) as M Resident AB Group by a;
Final:
NoConcatenate
LOAD * Resident AB Where M = b;
DROP Table AB;
 
					
				
		
Can you try this
A:
load * Inline [
a, b
1,2
2,3
3,8
];
Concatenate
B:
load * Inline [
a, b
1,5
2,3
4,3
5,4
];
NoConcatenate
AB:
load distinct a, b
Resident A;
drop table A;
 
					
				
		
 yura_ratu
		
			yura_ratu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks Alessandro!
But what if values are not numbers, or number which become both less or more. In final table should be value from second load, not matter what there
 
					
				
		
 yura_ratu
		
			yura_ratu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Result will be
1,2
1,5
2,3
3,8
4,3
5,4
 
					
				
		
 nagaiank
		
			nagaiank
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try loading in the following order:
load * Inline [
a, b
1,5
2,3
4,3
5,4
];
Concatenate
load * Inline [
a, b
1,2
2,3
3,8
]
where not exists(a);
 
					
				
		
You mean the result should be Ordered??
 
					
				
		
I get exactly the way you asked for the code snippet post my me earlier. Plz. see the screen shot.
 
					
				
		
 yura_ratu
		
			yura_ratu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I meant that should be unique "a" values, and "b" values from the latest load
 
					
				
		
 yura_ratu
		
			yura_ratu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It works! Thank you.
Could you please explain how this "where not exists(a)" statement works here?
