Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have some data that looks like the following:
CompanyCode | YearMonth | AutoNumber | NEW AutoNumber |
---|---|---|---|
A | 2015-01 | 1 | 1 |
A | 2015-02 | 2 | 2 |
A | 2015-03 | 3 | 3 |
B | 2015-01 | 4 | 1 |
B | 2015-02 | 5 | 2 |
C | 2014-10 | 6 | 1 |
C | 2014-11 | 7 | 2 |
My current AutoNumber expression in the script looks like:
AutoNumber(CompanyCode & '-' & YearMonth)
But it gives me a continues numbering like you see in the AutoNumber column example.
What I want to do is get my AutoNumber output to be like NEW AutoNumber column where it restarts after a new CompanyCode even if YearMonth values are similar.
Does anyone know how to do this please?
AutoNumber(CompanyCode & '-' & YearMonth, CompanyCode)
Just a minor remark: is the [NEW AutoNumber] value for the first CompanyCode=B row correct?
Thank you for pointing that out! I have corrected the example
AutoNumber(CompanyCode & '-' & YearMonth, CompanyCode)
AutoNumber(YearMonth, CompanyCode)
If you just want to restart the counter in your load script, see this discussion and the example document: Numbering Rows more examples? One of the three methods fits your bill
Peter.
Thank you so much Massimo you are a star!
Thank you Marco for your reply
Marco's answer is better than mine