Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

What is the use of AutoNumber() ??

HEy,

What is the use of AutoNumber() ?? Please help by an example.

Thanks

1 Solution

Accepted Solutions
Not applicable

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.

View solution in original post

18 Replies
Gysbert_Wassenaar

See this blog post: Counters in the Load

Or this one: QlikView Addict: QlikView Functions: autonumber()


talk is cheap, supply exceeds demand
Clever_Anjos
Employee
Employee

Usually for creating ID´s for composite fields

LOAD

    Autonumber(Customer & Company) as CustID

Not applicable

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

Not applicable

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
Specialist II
Specialist II
Author

HEy,

I didn't get you.

Can you explain it again ?

Thanks

Not applicable

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
Specialist II
Specialist II
Author

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

Not applicable

Yes you are right. its giving index(serial Number) to each unique records in that field.

Anonymous
Not applicable

yes Nikhil you are correct .

it works like surrogate Key in database.

it will generate incremental numbers llike , 1,2,3,4.....n