I am trying to generate a note/message in Kobo which should only appear for a random subset of surveys. For example, we are visiting 10 households in a day, so this message should appear in 5 randomly selected surveys.
Is there a way Kobo can randomize the survey number and use it to autogenerate this note/message?
If someone has tried this before, please let me know!
Please note, your implied definition of ‘random’ above is, well… strictly not random. Well, at least not in terms of determining within each survey whether or not to show this ‘random’ question. As defined - “of 10 households visited, 5 should show the question” - would require randomly picking a subset of 5 of the 10 a priori, and somehow communicating this pre-selected list to the device when filling in the 10 (and no more or no less) surveys. Picking a random number of 0 or 1 within each form will, on average, show the question 50% of the time, but there’s no guarantee that it will only show up on exactly 5 of the 10 surveys, or even show up on any of them at all!
Strictly speaking there is nothing (statistically) preventing exactly this from happening (without either a priori determining the 5 of 10, or somehow checking all previous instances - which then makes it no longer ‘random’).
Yes that should give you a random selection of either 0 or 1.
Kindly note that as inferred by @Xiphware this does not mean that when your run this twice and you get say 0 the first time, then the second run will be a 1. So in other words regardless of your randomisation you may still end with less or more than 5 out of 10. However this is still random but does not guranttee you an exact selection of only 5 out of 10 choices.