Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 berstrom
		
			berstrom
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hey! Is there a possibility to assign table names in a for loop that looks like follows:
for each vSheet in 'A', 'B', 'C'
[Table Name]:
load F1, F2, F3
from [data.xlsx]
(ooxml, embedded labels, table is $(vSheet));
next;
wheras the table names should be different for each of the 3 uploads?
Best regards
 acsaggar
		
			acsaggar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		simply use the for loop variable?
e.g.
$(vSheet):
load F1,F2,F3
from [data.xlsx]
(ooxml, embedded labels, table is $(vSheet));
next;
 acsaggar
		
			acsaggar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		also make sure you use noconcatenate if you want distinct tables
 berstrom
		
			berstrom
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks for the answer, but is there also a way in using a table name other than the loop variable?
 
					
				
		
 jfkinspari
		
			jfkinspari
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Sure, you could calculate the label in a variable, and use that.
e.g. LET TableLabel = IF($(vSheet) = 'A', 'New Label', 'Label for B and C')
$(TableLabel):
Load...
 berstrom
		
			berstrom
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks for the answer, but now I get for all tables the new name that I assigned to A even for B and C. The table names look like that:
'NewLabel', 'NewLabel-1', 'NewLabel-2'
Any idea why I the IF statement doesn't work as required?
 
					
				
		
 jfkinspari
		
			jfkinspari
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		How does your if() look?
 berstrom
		
			berstrom
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Basically as yours I think:
if($(vSheet) = 'A', 'NewA', 'NewBC')
 
					
				
		
 jfkinspari
		
			jfkinspari
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		The variable vSheet does might not need the $() expansion.
if(vSheet = 'A', 'NewA', 'NewBC')
 berstrom
		
			berstrom
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This results in the same problem as before with the difference that its now happening with 'NewBC'
