Discussions

 View Only
  • 1.  Random "number assignment"

    Posted 08-10-2022 21:51

    Hi! 

    I built a junior rodeo app and I'm wondering if there's a way I can do a "random draw" for scorecards.

    We have to generate a random sequence of numbers depending on how many players are in that event. Right now we're using a random number generator, and just taking whatever number order they generate and assigning it manually for over 1,000 scorecards. We have a report, and it's okay to type the number down the list, but it would be great if QB could generate a random draw for us! 

    Here's how it works: The "draw" determines when they come out of the gate - when it's their turn.

    Event A has 14 players, they need to be assigned random numbers.

    Event B has 12 players and need a random number assigned. etc and so on.

    Does anyone have any ideas?



    ------------------------------
    Renee Hansen
    ------------------------------


  • 2.  RE: Random "number assignment"

    Posted 08-11-2022 07:48
    Edited by Prashant Maheshwari 08-11-2022 07:48
    If you are ok with a slow pipeline/jinja solution (although it would be still faster than you manually copy pasting) ,It can generate random ID

    I tried updating a record with following formula and it works great 

    {{ range(1, 10000) | random }}


    ------------------------------
    Prashant Maheshwari
    ------------------------------



  • 3.  RE: Random "number assignment"

    Posted 08-11-2022 10:39
    That's a workable option! How would this work?

    ------------------------------
    Renee Hansen
    ------------------------------



  • 4.  RE: Random "number assignment"

    Posted 08-11-2022 10:39
    Actually I mean, how would I set it up?

    ------------------------------
    Renee Hansen
    ------------------------------



  • 5.  RE: Random "number assignment"

    Posted 08-11-2022 11:12
    Create two fields on your records you wish to generate random number
    • checkbox - GenerateRandom
    • text - RandomScore
    Create a pipeline
    • Trigger- When records are updated , when GenerateRandom=True
    • Update field RandomScore 
    • Value {{ range(1, 10000) | random }}


    ------------------------------
    Prashant Maheshwari
    ------------------------------



  • 6.  RE: Random "number assignment"

    Posted 08-11-2022 11:22
    Thanks! I'll give that a try!

    ------------------------------
    Renee Hansen
    ------------------------------



  • 7.  RE: Random "number assignment"

    Posted 08-11-2022 11:55
    It seems to be working, however, I am getting repeated numbers. Is there a way to not have that happen?



    ------------------------------
    Renee Hansen
    ------------------------------



  • 8.  RE: Random "number assignment"

    Posted 08-11-2022 13:28
    I think this is the proper result . Each record is random , 

    What you are looking for is a list of unique random numbers between 1-100 

    I think excel might be an easier feature here.Export a CSV in excel with 

    Record ID# | DrawTest

    In Drawtest you can put the formula =SORTBY(SEQUENCE(100),RANDARRAY(100))

    Then import it back into QuickBase 

    PS : This is in excel 365 




    ------------------------------
    Prashant Maheshwari
    ------------------------------



  • 9.  RE: Random "number assignment"

    Posted 08-11-2022 14:44
    I'm trying really hard to stay out of excel.

    ------------------------------
    Renee Hansen
    ------------------------------



  • 10.  RE: Random "number assignment"

    Posted 08-14-2022 23:34
    Yeah , I understand , I would also love to have QuickBase only solution . If you do manage to figure this out , let me know I would also love to know

    ------------------------------
    Prashant Maheshwari
    ------------------------------