Counting groups
Tuesday, 17 July 2012 · 3 messages
MS
Hi Pascal,
maybe you already tried that; but:
let $somethings := for $varGrp at $pos in local:getVariables($from,$to)
group by $name := string($varGrp/@name)
return <Something/>
for $something at $pos in $somethings
return...Hope this helps, this is the best I can think of at the moment :)
Kind regards
Michael
Quoted text · Pascal Heus · 21 lines
Am 17.07.2012 um 13:29 schrieb Pascal Heus: > All: > In a group by query expression like > for $varGrp at $pos in local:getVariables($from,$to) > group by $name := string($varGrp/@name) > return <Something/> > is there any way to get a value or position for the group count? > > In my particular use case, I used this to generate an HTML table and I would like to repeat the header every 20-30 rows (group). The "at $pos" variable can't be used as it holds a sequence of positions of the group members (which is what it's supposed to). > > Any suggestion appreciated. > best > *P > > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
PH
Pascal Heus17 Jul 2012 15:29 #
All:
In a group by query expression like
for $varGrp at $pos in local:getVariables($from,$to)
group by $name := string($varGrp/@name)
return <Something/>
is there any way to get a value or position for the group count?
In my particular use case, I used this to generate an HTML table and I would like to repeat the header every 20-30 rows (group). The "at $pos" variable can't be used as it holds a sequence of positions of the group members (which is what it's supposed to).
Any suggestion appreciated.
best
*P
PH
Thanks Michael. I ended up with something similar :-)
best
*P
Quoted text · Michael Seiferle · 38 lines
On 7/17/12 9:10 AM, Michael Seiferle wrote: > Hi Pascal, > > maybe you already tried that; but: > > let $somethings := for $varGrp at $pos in local:getVariables($from,$to) > group by $name := string($varGrp/@name) > return <Something/> > for $something at $pos in $somethings > return... > > Hope this helps, this is the best I can think of at the moment :) > > Kind regards > Michael > Am 17.07.2012 um 13:29 schrieb Pascal Heus: > >> All: >> In a group by query expression like >> for $varGrp at $pos in local:getVariables($from,$to) >> group by $name := string($varGrp/@name) >> return <Something/> >> is there any way to get a value or position for the group count? >> >> In my particular use case, I used this to generate an HTML table and I would like to repeat the header every 20-30 rows (group). The "at $pos" variable can't be used as it holds a sequence of positions of the group members (which is what it's supposed to). >> >> Any suggestion appreciated. >> best >> *P >> >> >> >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 7.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery