Am 04.04.2022 um 16:16 schrieb Markus Elfring:
for $x in $results
group by $count := $x(1)
I tried the code variant βfor $r in $results let $count := $r(1)β also out. But I wonder that the incidence β1β (only one) would be determined then for all record set counters.
As I said, consider to provide an input/output sample of what you have and want to achieve, don't make us guess from your failing queries what input data you have and which result you want.
A further guess would be that perhaps
for $x in $results
group by $count := $x(1)
let $incidence := count($x)
with the way XQuery binds variables might help as that way the $incidence what have the values of items in each group established by the `group by` clause on the `for $x`.