Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
nikhilgarg
Valued Contributor

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

Re: What is the use of AutoNumber() ??

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.

17 Replies
MVP & Luminary
MVP & Luminary

Re: What is the use of AutoNumber() ??

See this blog post: Counters in the Load

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


talk is cheap, supply exceeds demand
Employee
Employee

Re: What is the use of AutoNumber() ??

Usually for creating ID´s for composite fields

LOAD

    Autonumber(Customer & Company) as CustID

Not applicable

Re: What is the use of AutoNumber() ??

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

Re: What is the use of AutoNumber() ??

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
Valued Contributor

Re: What is the use of AutoNumber() ??

HEy,

I didn't get you.

Can you explain it again ?

Thanks

Not applicable

Re: What is the use of AutoNumber() ??

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
Valued Contributor

Re: What is the use of AutoNumber() ??

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

Re: What is the use of AutoNumber() ??

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

balkumarchandel
Valued Contributor II

Re: What is the use of AutoNumber() ??

yes Nikhil you are correct .

it works like surrogate Key in database.

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