Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
Simple question.
I have a table:
Date | Info |
---|---|
2016-09-30 | A |
2016-10-31 | A |
2016-11-30 | A |
2016-09-30 | B |
2016-10-31 | B |
2016-11-30 | B |
I do need this:
Date | Info | Number |
---|---|---|
2016-09-30 | A | 1 |
2016-10-31 | A | 2 |
2016-11-30 | A | 3 |
2016-09-30 | B | 1 |
2016-10-31 | B | 2 |
2016-11-30 | B | 3 |
Thank you
May be like this:
AutoNumber(RecNo(), Info) as Number
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.
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;
This solution works faster.
Did not know AutoNumber performed that poorly. Thanks for updating mindaugasbacius