Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

What is the use of AutoNumber() ??

HEy,

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

Thanks

1 Solution

Accepted Solutions
Highlighted
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
Highlighted
MVP & Luminary
MVP & Luminary

See this blog post: Counters in the Load

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


talk is cheap, supply exceeds demand
Highlighted
Employee
Employee

Usually for creating ID´s for composite fields

LOAD

    Autonumber(Customer & Company) as CustID

Highlighted
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

Highlighted
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.

Highlighted
Specialist
Specialist

HEy,

I didn't get you.

Can you explain it again ?

Thanks

Highlighted
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

Highlighted
Specialist
Specialist

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

Highlighted
Not applicable

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

Highlighted
Specialist II
Specialist II

yes Nikhil you are correct .

it works like surrogate Key in database.

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