Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to invert the AutoNumber function. I have a list of forecast submissions where I want the latest submission date to be nr 1 and the oldest to be the highest number.
As it is now it is giving the latest submission date the highest number and the oldest nr 1. How do I write in the script to invert the numbering?
Thanks for any help!
Hi Fredrik,
do it in several steps, without the AutoNumber() function:
- Sort the table by submission_date in desc. order (to have the latest date on top)
- Create a recordno() field to number the records
=> You can still use AutoNumber() if you want, but the recordno() should do as well.
HTH
Best regards,
DataNibbler
Hello Fredrik,
The AutoNumber() fonction will create it's associated numeric values according to the order in which the different values of the expression received as a parameter are met. Simply preorder the data using a preceding load in the desired manner (latest vs oldest submission), and you shall have the desired result.
Regards,
Philippe
Hi Fredrik,
you could try this:
10000000 - AutoNumber(..)
Max. value depending on amount of records.
- Ralf
May be with the help Order By in descending
Load
Field,
SubmissionDate,
Autonumber(FieldName) As FieldAutonumber
From Source
Order By SubmissionDate Desc;