From: michiel <mi...@be...> - 2006-02-17 20:28:55
|
Hi, I tried calculating rowlevel percentages of a total of a break wich should show a result like: # % 3 75 1 25 _ 4 using: <Variable name="sumnumber" value="val(q.number)" type="sum" resetonbreak="Maand" precalculate="yes"/> <Variable name="sumturnaround" value="val(q.turnaround)" type="sum" resetonbreak="Maand" precalculate="yes"/> <Variable name="perc_number" value="(val(q.numberl)/v.sumaantal)*100" type="expression" resetonbreak="Maand" /> <Variable name="perc_turnaround" value="(val(q.turnaround)/v.sumturnaround)*100" type="expression" resetonbreak="Maand" /> and showing them (q being the main query): <field value="q.aantal" width="10" align="right" col="3"/> <field value="val(q.turnaround)/100" width="10" align="right" format="'!# %.02f'" col="5"/> <field value="v.perc_number" width="10" align="right" format="'!# %.01f'" col="6" /> <field value="v.perc_turnaround" width="10" align="right" format="'!# %.01f'" col="7" /> But see percentages > 100%... As precalculate and delayed are not documented I'm kind of guessing and experimenting ;) Can this be done with RLIB and if so how should it be done.. |