Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 1adam_haj
		
			1adam_haj
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello, I have two tables:
1) Document table
| Document | Value | Version | 
| 20Z001 | 5 | 1 | 
| 20Z001 | 7 | 2 | 
2) Last Version of document
| Document | Last_version | 
| 20Z001 | 2 | 
And I want load data only from the last version of the document. Can I make some exeptional LOAD where i could load only rows where Version matches Last version from another table ?
 
					
				
		
 lironbaram
		
			lironbaram
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hi
yes you can 
something like this will work 
latestversions:
Load Document,
     Last_version,
     Document & '_' & Last_version as docKey
from XXX;
Data:
Load * 
From YYY
where exists(docKey,Documnet & '_' & Version); 
					
				
		
 lironbaram
		
			lironbaram
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hi
yes you can 
something like this will work 
latestversions:
Load Document,
     Last_version,
     Document & '_' & Last_version as docKey
from XXX;
Data:
Load * 
From YYY
where exists(docKey,Documnet & '_' & Version); Vegar
		
			Vegar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This would solve your issue.
[Final table]:
Load 
   Document,
   Last_version as Version
From LastVersion_Soure
;
Left join ([Final table]) 
Load *
From  DocumentTable_Source
;
