Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Reset Variable over each group
BoydKelly
Hello,
I need to reset a variable for each group. As a simple test I am just using a myrowcount variable. I want the myrowcount to restart at 1 for each group in the data set.
To start with:
In the Report Design/beforeRender, I have: var myrowcount = 1;
In the Table Detail/onCreate, I have: myrowcount = myrowcount +1;
I have a data element set to myrowcount and this works as expected for counting the lines of the entire report.
However I would like to reset myrowcount to 1 at the start of each group. I tried to put a myrowcount = 1 at the Table Group Header/onCreate level and Table Group Row/onCreate. But this seemed to give strange results.
How can I do this?
My objective of course is a variable and script a bit more complicated, but this should at least point me in the right direction.
Thanks,
Boyd
Find more posts tagged with
Comments
Tubal
I just tried this in Birt 3.7.1 and it seemed to work:
Report beforeRender: var myrowcount = 1;
Detail onCreate: myrowcount++;
Group Footer onCreate: myrowcount = 1;
(I normally put my global variables in onInitialize)
Thanks.
BoydKelly
This works perfectly. Thanks!