Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 nikhilgarg
		
			nikhilgarg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HEy,
What is the use of AutoNumber() ?? Please help by an example.
Thanks
 
					
				
		
If we have Employee Name as the Key to join two tables then it will join on the bases of Char fields ie Nikhil Garg.
But if we do autonumber(Employee Name) then it will give unique number to each record in Employee Name field. So instead of Nikhil Garg it can be numbers i.e. 1. So the performance may increase there is huge records in Employee Name fields, as we are joining on the bases of index(integer) instead of Char.
 Gysbert_Wassena
		
			Gysbert_WassenaSee this blog post: Counters in the Load
Or this one: QlikView Addict: QlikView Functions: autonumber()
 Clever_Anjos
		
			Clever_Anjos
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Usually for creating ID´s for composite fields
LOAD
Autonumber(Customer & Company) as CustID
 
					
				
		
Hi,
The AutoNumber() function is useful if you want to put a number on a specific field value, or on an attribute that is a combination of field values. The attributes will be numbered and their numbers re-used appropriately.
AutoNumber( Product & '|' & Date ) as ID
 
					
				
		
autonumber(expression[ , AutoID])
Returns a unique integer value for each distinct evaluated value of expression encountered during the script execution. This function can be used e.g. for creating a compact memory representation of a complex key.
In order to create multiple counter instances if the autonumber function is used on different keys within the script, an optional parameter AutoID can be used for naming each counter.
Examples:
autonumber( Region&Year&Month )
autonumber( Region&Year&Month, 'Ctr1' )
Autonumber is basically used to generate index which will help in joining the table and improve the processing time.
 nikhilgarg
		
			nikhilgarg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HEy,
I didn't get you.
Can you explain it again ?
Thanks
 
					
				
		
If we have Employee Name as the Key to join two tables then it will join on the bases of Char fields ie Nikhil Garg.
But if we do autonumber(Employee Name) then it will give unique number to each record in Employee Name field. So instead of Nikhil Garg it can be numbers i.e. 1. So the performance may increase there is huge records in Employee Name fields, as we are joining on the bases of index(integer) instead of Char.
 nikhilgarg
		
			nikhilgarg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HEy,
Ok i got it . I tried a n example with auto number. It just acts like a serial Number in front of fields.
Isn't it ??
thanks
 
					
				
		
Yes you are right. its giving index(serial Number) to each unique records in that field.
 
					
				
		
yes Nikhil you are correct .
it works like surrogate Key in database.
it will generate incremental numbers llike , 1,2,3,4.....n
