# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for
Did you mean:
Creator II

## similar to the SQL Function ROW_NUMBER() OVER Clause in QlikView?

Hi,

I would like to know if QlikView has any function which is similar to the SQL Function ROW_NUMBER() OVER Clause?

Otherwise I would ask "How can I calculate the number of occurrences of a value in a field like below?"

In this below table, I want to calculate the Count column.

 Count Command Quantity 1 A 3 2 A 2 3 A 3 1 B 4 2 B 3 3 B 2 4 B 6

Thanks,

Andrew Hudson.

1 Solution

Accepted Solutions
Master III

Command,Quantity

A,3

A,2

A,3

B,4

B,3

B,2

B,6 ]

7 Replies
Master III

Command,Quantity

A,3

A,2

A,3

B,4

B,3

B,2

B,6 ]

MVP

Quantity,

AutoNumber(RecNo(),Command) as Count

Inline [

Command,Quantity

A,3

A,2

A,3

B,4

B,3

B,2

B,6 ];

Master III

If Command is not sorted, then try this

Initial:

Command,Quantity

A,3

A,2

A,3

B,4

B,3

B,2

B,6];

NoConcatenate

Final:

Load Command,Quantity,AutoNumber(RecNo(),Command) Resident Initial Order by Command;

Drop table Initial;

Not applicable

AutoNumber(RecNo(),Command)

//the inline statement with variables

group by Command

Master III

Using Peek

Initial:

Command,Quantity

A,3

A,2

A,3

B,4

B,3

B,2

B,6];

NoConcatenate

Final:

Load Command,Quantity,If(Command <> Peek(Command),1,Peek(Count)+1) as Count Resident Initial Order by Command;

Drop table Initial;

Creator II
Author

Thank you Anbu..

It works for me..