Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Row number

Hello

Simple question.

I have a table:

DateInfo
2016-09-30

A

2016-10-31A
2016-11-30A
2016-09-30B
2016-10-31B
2016-11-30B

I do need this:

DateInfoNumber
2016-09-30

A

1
2016-10-31A2
2016-11-30A3
2016-09-30B1
2016-10-31B2
2016-11-30B3

Thank you

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

AutoNumber(RecNo(), Info) as Number

View solution in original post

5 Replies
sunny_talwar

May be like this:

AutoNumber(RecNo(), Info) as Number

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

Do you have any other solutions as this one increased the loading time dramatically?

I could live with this but I would like to be sure that this method is most efficient. Thanks.

sunny_talwar

Not sure if this is going to be any better, but this is the other option. If the data is already sorted, then you might not need to create FinalTable and should be able to create Number field within Table.

Table:

LOAD Date,

    Info

FROM

[https://community.qlik.com/thread/235909]

(html, codepage is 1252, embedded labels, table is @1);

FinalTable:

LOAD Date,

  Info,

  If(Info = Previous(Info), RangeSum(Peek('Number'), 1), 1) as Number

Resident Table

Order By Info, Date;

DROP Table Table;

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

This solution works faster.

sunny_talwar

Did not know AutoNumber performed that poorly. Thanks for updating mindaugasbacius