Discussions

Expand all | Collapse all

Multiple Counter Values

  • 1.  Multiple Counter Values

    Posted 13 days ago
    Hi, I am currently trying to make a program that uses an ID in order to identify a specific item.  My ID follows the following format: www-xx-yy-zzz.
    For example, a yellow highlighter might have the ID 001-01-01-001. 
    The method behind the ID is that www designates the category, xx designates the class, and yy designates the division. The zzz part is meant to be a the number that the item was added under those three categories. 
    Continuing with my highlighter example:
    The yellow highlighter was added first so its ID was 001-01-01-001
    You now want to a red highlighter so its ID would be 001-01-01-002
    I want the last number to be auto generated from the first 3 categories.

    How would I go about doing this? My first idea was to create a separate table containing all the IDs for the first 3 categories and a counter that goes along with each ID.

    ------------------------------
    Tom Leick
    ------------------------------


  • 2.  RE: Multiple Counter Values

    Posted 13 days ago
    imho, its not worth the effort to auto sequence.  Just use the Record ID# as the suffix.  I can point you to articles on how to do this, but it's, in my opinion, just not worth the effort.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Multiple Counter Values

    Posted 13 days ago
    Would you mind sending me the articles?

    ------------------------------
    Tom Leick
    ------------------------------



  • 4.  RE: Multiple Counter Values

    Posted 13 days ago
    sure, here are some links

    https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=d30c143b-d701-410b-b933-bc4874f403b6&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer

    https://community.quickbase.com/blogs/matthew-brisch1/2020/01/22/auto-numbering-in-quick-base

    https://community.quickbase.com/browse/blogs/blogviewer?BlogKey=ef9eca41-cd5f-4711-bf42-f9d9f26c6c7a&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=blogviewer


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    and here is an answer among several I once posted.


    Basically the idea is to create a [Sequence #] field which is based on a formula which will start off the numbering by Department at whatever number you want to start at.

    var number StartNumber =
    Case([Department Number],
    "10",1234,
    "20",2000);

    Max($StartNumber,[Sequence # snapshot])

    Then we make a field called [Sequence # plus 1] which is the formula of [Sequence #] +1, and make a summary of the Maximum that field.

    and then do a lookup back down to the Antiques Table and then take a snapshot of that field called [Sequence # snapshot]

    By doing a snapshot we ensure that the numbers don't all get jiggled down when a record is deleted.

    The actual Serial # we display is this formula.

    [Department Number] & "-" & Right("00000" & ToText([Sequence #]),6)


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------