Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Autonumber starts from vMaxAutoNumber

MaxNumber:

LOAD

          num(max(%_KEY_SALES_FACT)) AS MaxAutoNumber

RESIDENT SALES_HEADER ;

LET vMaxAutoNumber = peek('MaxAutoNumber', 0, 'MaxNumber');

vMaxAutoNumber=1200;

SALES_HEADER:

LOAD

     AUTONUMBER(COMPANY & TRN_NO) as %_KEY_SALES_FACT

Resident XX ;

I want to start my autonumber from vMaxAutoNumber>1200.

Please sugest how to write autonumber syntax.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Add 1200 to it:

SALES_HEADER:

LOAD

     1200 + AUTONUMBER(COMPANY & TRN_NO) as %_KEY_SALES_FACT

Resident XX ;

Something that you have to keep in mind is that autonumber is not guaranteed to hand out the same number across different reloads, only during the same reload. Meaning that you can't count on it to always generate the exact same number for the same company&trn_no combination. You can get different numbers the next day when your document is reloaded again to refresh the data.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Add 1200 to it:

SALES_HEADER:

LOAD

     1200 + AUTONUMBER(COMPANY & TRN_NO) as %_KEY_SALES_FACT

Resident XX ;

Something that you have to keep in mind is that autonumber is not guaranteed to hand out the same number across different reloads, only during the same reload. Meaning that you can't count on it to always generate the exact same number for the same company&trn_no combination. You can get different numbers the next day when your document is reloaded again to refresh the data.


talk is cheap, supply exceeds demand
Not applicable
Author

Yeah i hav done also in the same way u hav done.

Thanks 4 ur prompt reply.

Regards,

Sukamal