Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Autonumber for New Item

Hi!  I am hoping someone can help me on this...

I  have a script   below which I want to number by OrderNo...but it's not what I expected  ...  I'd like to have an output based on the table  as below highlighted in yellow.

Order:
load*,

autonumberhash128([OrderNo) as Sequence

Resident Order
order by [OrderNo];
Drop table Order;

Thank you in advance...

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi:  Sunny,

It worked... I just need to take out the ' '  in Peek('DesiredOutput') and make as Peek([Desired Output]) ...

Thank you much...

View solution in original post

7 Replies
sunny_talwar

Try this

Table:

LOAD * INLINE [

    OrderNo

    A682

    A904

    A913

    A913

    B576

    B577

    B578

    B578

    B578

    C588

    D589

    E137

];

FinalTable:

LOAD RowNo() as RowNum,

  *,

  If(OrderNo = Previous(OrderNo), Peek('DesiredOutput'), RecNo()) as DesiredOutput

Resident Table

Order By OrderNo;

DROP Table Table;

Anonymous
Not applicable
Author

Hi:  Sunny,

It worked... I just need to take out the ' '  in Peek('DesiredOutput') and make as Peek([Desired Output]) ...

Thank you much...

Anonymous
Not applicable
Author

peek() works with single quotes!

Anonymous
Not applicable
Author

HI! It reloads successfully but  there are missing numbers with the single quotes.

sunny_talwar

That is because you named your column as Desired Output with a space.... mine was without space

FinalTable:

LOAD RowNo() as RowNum,

  *,

  If(OrderNo = Previous(OrderNo), Peek('DesiredOutput'), RecNo()) as DesiredOutput

Resident Table

Order By OrderNo;

DROP Table Table;

Anyways, I encourage you to open the attached file to check out the app to see that it was actually working in there

Anonymous
Not applicable
Author

I actually did open it and that's when I realized it must have something to do with the space....

sunny_talwar

Great.... I am glad it helped you...