Auto Number

Hi,

I have a list of numbers, they are used for unique product codes. 

As you can see the last number we used was 201028.

bvfskuid.png

 

When a user enters a product in another module, it looks up the BVFSKUID from this list using the BVFSKU column, If there is no matching record, we need to create a new line in this list, with the BVFSKU Description they have, and a new BVFSKUID using the next number (201029) automatically.

 

How do i find the next (maximum) number in this list, so i can increase by 1 and use????

 

thanks

Best Answers

  • DavidSmith
    Answer ✓

    1 Create a module (if not already) by the list

    2. Add two line items

    - Code = CODE(ITEM(listname))

    - Code Value = VALUE(Code)

    3. Set the summary option for Code Value to MAX

    4. you can then refer to this in your creation module

     

    I hope that helps

    David

  • DavidSmith
    Answer ✓

    @DeveloperCYT  

    In any module that doesn't contain the numbered list, you can just point the line item to the number code and it will return the MAX value

    Get well soon!!

     

    @kavinkumar We should avoid using TEXTLIST whenever possible due to the memory overhead

     - Planual rule 2.02-11

     

    In this case the Top level item will be much more efficient than TEXTLIST

     

    David

     

Answers

  • Hi David,

    Hi, I had tried that but i now have a module with a number...

    clipboard_image_0.png

    I still don't know how i can reference it?

     

    What am i missing, something simple no doubt

  • Look at the bottom (Top level item) and if the summary method is set to Max, you will see the last/maximum number created

    David

  • How do i look at the bottom (top level item)?

  • Scroll down?!

     

    If you can't see it, have you got a filter or "select levels" turned on

     

    As it's a top level, you can point another line item that is not dimensioned by the list and it will return the value.

     

    You may want to hold this in a separate module; but it will depend on the logic for you building the numbered list

     

    David

  • That is the bottom. 

    I have no filters on.

    No levels selected, it is pure brand new module.

    The summary is set to MAX

    clipboard_image_0.png

  • In the configure tab for the list, set a top level item, then you will have the MAX at the bottom

    David

  • Aha, i have a maximum now..

    Sorry, i am quite poorly and brain is on 25%....

    How do i now refer to that in my creation module?

     

    thanks for this, its so simple but so is breathing usually    🙂

     

    Much thanks again, it really is appreciated

  • HI @DeveloperCYT,

    Try this, You don't need to set up any top level items.

    Create a module with this list as dimension and create line items and put the formula as per SS.

    Auto Number.PNG

     Now you can refer the 'Max' line item to proceed further.

    Sample:

    Auto Number 1.PNG

     As 4 is my latest entry, I have to capture '4' in a non-dimensional line item.

     

    Auto Number 2.PNG

     I hope your problem is resolved. Let me know if you have any concerns.

    Regards,
    Kavin.

     

  • Oh thats good to know. Thanks!! 

    I thought in this case they purposely didn't add the top level item ;).

  • Thank you David for your quick response, and solution

    Thanks Kavin for an alternative idea, but i am using the 'efficient' one

     

    Have a good day both, as ever the help is greatly appreciated.

  • @kavinkumar 

    If you haven't already, take a look here

     

    https://community.anaplan.com/t5/Best-Practices/The-Planual/ta-p/49773

     

    We've put all of the "rules" here with some explanations of thew "why".

     

    We are going to add more of the "explanations" for the next version

     

    David