Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

create number

Hi all,

i am working with a source table that contains history data. It contains for one specific object multiple records.

Each record corresponds to a change of the object that happened in the past.

I need to numerate every history record for each object.

The source table looks something like this:

ObjectIDHistoryIDChangeRecordCreated
111some text here...2013-01-03 08:34:12
112some text here...2013-01-04 11:33:13
213some text here...2013-01-13 07:56:23
114some text here...2013-02-11 10:11:41

Now i'd like to create a new field in this table - let's call it JournalNumber, whould basically count the records for every object sorted by RecordDate asc:

ObjectIDHistoryIDChangeRecordDateJournalNumber
111some text here...2013-01-03 08:34:121
112some text here...2013-01-04 11:33:132
213some text here...2013-01-13 07:56:231
114some text here...2013-02-11 10:11:413

Any idea, how this can be done ?

Thanks a lot!

1 Reply
swuehl
MVP
MVP

Try as additional field in your load script:

LOAD

     ...

     autonumber(HistoryID, ObjectID) as JournalNumber,

     ...

edit: to get your JournalNumber field ordered by Date, you may need to use an order by in your load statement.