I want people to submit a survey, which has a unique, random number that is hidden to the end user. This number will be used as part of a "lottery" drawing, once all surveys have been submitted. The unique, random number will be sorted low to high, and the lowest 10 numbers will be winners. I envision my staff running a manual sort of the number in a web map, and then manually keying in a Selected = YES to the lowest 10 numbers. Any ideas how to do this? I know Global ID's are unique, but not necessarily random. I'm trying to make is as simple as possible for non-technical staff to run. I'd like to avoid ArcMap and ArcPro if possible - and do everything in ArcGIS Online, Survey123, web maps, etc.
How much more random can a Global ID get? You could look at a GUID field. I've used the procedure described here How To: Calculate unique identifier values similar to Global IDs but I couldn't tell you how to do that in Survey 123.
Hi Joe - I guess I just don't really know how random a Global ID is. I know they are unique - but if you use that number and sort ascending or descending, assuming it to be random - Is it truly random? Would a person receive preferential ranking if they submitted their survey first, or last? I don't really know. It seems that I have read that they are not random...
Here is a screen shot of 30 out of 3341 GlobalIDs sorted in ascending order:
From What is random numbers? - Definition from WhatIs.com :
Random numbers are numbers that occur in a sequence such that two conditions are met: (1) the values are uniformly distributed over a defined interval or set, and (2) it is impossible to predict future values based on past or present ones. Random numbers are important in statistical analysis and probability theory
Do they meet the two criteria?
I don't believe there's any way to guarantee that it's unique (edit: without using a GlobalID, I mean).
How many responses do you expect to have? You could try using random() in a calculation. This returns a value between 0 (inclusive) and 1 (exclusive). For a more "friendly" number you can multiply it by a value and round it off, for example round(random()*100000,0) results in a range of 0 to 100,000. You could then use another random() function in a second question to be used as a tie-breaker, because hopefully no one will end up with the same random lotto number and identical tie-breaker numbers, but who knows? Or maybe even use a timestamp as a tie-breaker?
Thanks for chiming in Nick. Realistically, there will probably be fewer than 100 survey entries. So maybe I'm overthinking the chances of having to random numbers come out the same. Using your rounding and/or a tiebreaker field would probably insure that I never have a problem (with so few entries). I'll try a few approaches and see what I find.
Hi Ken,
Take a look at this blog post also: https://community.esri.com/groups/survey123/blog/2017/11/25/creating-ticket-numbers-in-survey123-for...
Phil.