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)
Implementing complex table or crosstab
bentotdecruz
<p>I have a very complicated table below that I need to implement either using table/crosstab. When I use table, I tried to make the grouping but I wan't able to do it. I thought of putting all the Usage(s) and below in footer. When I tried to do 3 sets of crosstabs (1 for Usage, 1 for Receipts, and 1 for Sources), the rows are no longer aligned. Need your advise what is the correct implementation for such table below:</p>
<p> </p>
<p>There are many cards. I need to create the same table for each card. For the Usage date, there are only 2 groups (If today is March 2013, the 2 groups will be Apr12-Mar13 and Apr13-Mar14). UsageA-E are fixed rows. For the Receipts, there are only 2 groups (last 12 months and next 12 months). RcptA-C are fixed rows and need to compute the average of them in the "Ave" row. The Tier is completely different group, it's just a Reqt/Resp columns. For the Sources, the date column can vary depending on how many dates are needed to be displayed. Item(s) will vary as well. But ScrA-F are fixed rows.</p>
<p> </p>
<p><span style="font-size:10px;"><span style="font-family:'courier new', courier, monospace;">Card1<br>
<br>
Usage | Receipts | Sources<br>
<br>
Date: | Apr12-Mar13 | Apr13-Mar14 | Period | Last12m | Next12m | Dates | 12/31/12 | 12/31/13 | 12/31/14 | 12/31/15<br>
<br>
| | | | | | Item1 | Y | N | N | Y <br>
<br>
| | | | | | Item2 | N | N | Y | Y <br>
<br>
UsageA | 12 | 10 | RcptA | 80% | 20% | SrcA | 15 | 12 | 5 | 12 <br>
<br>
UsageB | 52 | 100 | RcptB | 66% | 25% | SrcB | 12 | 10 | 4 | 12 <br>
<br>
UsageC | 24 | 42 | RcptC | 89% | 18% | SrcC | 11 | 5 | 5 | 11 <br>
<br>
UsageD | 13 | 55 | Ave | 78.33% | 21% | SrcD | 18 | 12 | 7 | 23 <br>
<br>
UsageE | 13 | 55 | Tier | Reqt | Resp | SrcE | 13 | 11 | 0 | 13 <br>
<br>
| | | | Y | N | SrcF | 22 | 19 | 9 | 16 <br>
</span></span></p>
Find more posts tagged with
Comments
JFreeman
<p>What version of BIRT are you using?</p>
<p> </p>
<p>Is it possible for you to provide a flat file, such as a CSV, with sample data that reflects that structure of the data you will be using?</p>
bentotdecruz
<p>I'm using BIRT 2.3.2.2</p>
<p>Below are sample records:</p>
<p> </p>
<p>CARD_NAME,CATEGORY,SUBCAT,CHILD,SUBCHILD,VALUE<br>
Card1,Usage,Apr12-Mar13,UsageA,,12<br>
Card1,Usage,Apr12-Mar13,UsageB,,52<br>
Card1,Usage,Apr12-Mar13,UsageC,,24<br>
Card1,Usage,Apr12-Mar13,UsageD,,13<br>
Card1,Usage,Apr12-Mar13,UsageE,,13<br>
Card1,Usage,Apr13-Mar14,UsageA,,10<br>
Card1,Usage,Apr13-Mar14,UsageB,,100<br>
Card1,Usage,Apr13-Mar14,UsageC,,42<br>
Card1,Usage,Apr13-Mar14,UsageD,,55<br>
Card1,Usage,Apr13-Mar14,UsageE,,55<br>
Card1,Receipts,Last12m,RcptA,,0.8<br>
Card1,Receipts,Last12m,RcptB,,0.66<br>
Card1,Receipts,Last12m,RcptC,,0.89<br>
Card1,Receipts,Next12m,RcptA,,0.2<br>
Card1,Receipts,Next12m,RcptB,,0.25<br>
Card1,Receipts,Next12m,RcptC,,0.18<br>
Card1,Tier,Reqt,,,Y<br>
Card1,Tier,Resp,,,N<br>
Card1,Sources,12/31/2012,Item,Item1,Y<br>
Card1,Sources,12/31/2012,Item,Item2,N<br>
Card1,Sources,12/31/2012,Src,SrcA,15<br>
Card1,Sources,12/31/2012,Src,SrcB,12<br>
Card1,Sources,12/31/2012,Src,SrcC,11<br>
Card1,Sources,12/31/2012,Src,SrcD,18<br>
Card1,Sources,12/31/2012,Src,SrcE,13<br>
Card1,Sources,12/31/2012,Src,SrcF,22<br>
Card1,Sources,12/31/2013,Item,Item1,N<br>
Card1,Sources,12/31/2013,Item,Item2,N<br>
Card1,Sources,12/31/2013,Src,SrcA,12<br>
Card1,Sources,12/31/2013,Src,SrcB,10<br>
Card1,Sources,12/31/2013,Src,SrcC,5<br>
Card1,Sources,12/31/2013,Src,SrcD,12<br>
Card1,Sources,12/31/2013,Src,SrcE,11<br>
Card1,Sources,12/31/2013,Src,SrcF,19<br>
Card1,Sources,12/31/2014,Item,Item1,N<br>
Card1,Sources,12/31/2014,Item,Item2,Y<br>
Card1,Sources,12/31/2014,Src,SrcA,5<br>
Card1,Sources,12/31/2014,Src,SrcB,4<br>
Card1,Sources,12/31/2014,Src,SrcC,5<br>
Card1,Sources,12/31/2014,Src,SrcD,7<br>
Card1,Sources,12/31/2014,Src,SrcE,0<br>
Card1,Sources,12/31/2014,Src,SrcF,9<br>
Card1,Sources,12/31/2015,Item,Item1,Y<br>
Card1,Sources,12/31/2015,Item,Item2,Y<br>
Card1,Sources,12/31/2015,Src,SrcA,12<br>
Card1,Sources,12/31/2015,Src,SrcB,12<br>
Card1,Sources,12/31/2015,Src,SrcC,11<br>
Card1,Sources,12/31/2015,Src,SrcD,23<br>
Card1,Sources,12/31/2015,Src,SrcE,13<br>
Card1,Sources,12/31/2015,Src,SrcF,16<br>
Card2,Usage,Apr12-Mar13,UsageA,,34<br>
Card2,Usage,Apr12-Mar13,UsageB,,44<br>
Card2,Usage,Apr12-Mar13,UsageC,,2<br>
Card2,Usage,Apr12-Mar13,UsageD,,13<br>
Card2,Usage,Apr12-Mar13,UsageE,,15<br>
Card2,Usage,Apr13-Mar14,UsageA,,33<br>
Card2,Usage,Apr13-Mar14,UsageB,,12<br>
Card2,Usage,Apr13-Mar14,UsageC,,34<br>
Card2,Usage,Apr13-Mar14,UsageD,,22<br>
Card2,Usage,Apr13-Mar14,UsageE,,10<br>
Card2,Receipts,Last12m,RcptA,,0.65<br>
Card2,Receipts,Last12m,RcptB,,0.1<br>
Card2,Receipts,Last12m,RcptC,,0.35<br>
Card2,Receipts,Next12m,RcptA,,0.4<br>
Card2,Receipts,Next12m,RcptB,,0.9<br>
Card2,Receipts,Next12m,RcptC,,0.8<br>
Card2,Tier,Reqt,,,N<br>
Card2,Tier,Resp,,,N<br>
Card2,Sources,12/31/2012,Item,Item21,Y<br>
Card2,Sources,12/31/2012,Item,Item22,Y<br>
Card2,Sources,12/31/2012,Item,Item23,N<br>
Card2,Sources,12/31/2012,Item,Item24,N<br>
Card2,Sources,12/31/2012,Item,Item25,N<br>
Card2,Sources,12/31/2012,Src,SrcA,11<br>
Card2,Sources,12/31/2012,Src,SrcB,34<br>
Card2,Sources,12/31/2012,Src,SrcC,55<br>
Card2,Sources,12/31/2012,Src,SrcD,34<br>
Card2,Sources,12/31/2012,Src,SrcE,12<br>
Card2,Sources,12/31/2012,Src,SrcF,10<br>
Card2,Sources,12/31/2013,Item,Item21,N<br>
Card2,Sources,12/31/2013,Item,Item22,Y<br>
Card2,Sources,12/31/2013,Item,Item23,N<br>
Card2,Sources,12/31/2013,Item,Item24,Y<br>
Card2,Sources,12/31/2013,Item,Item25,Y<br>
Card2,Sources,12/31/2013,Src,SrcA,50<br>
Card2,Sources,12/31/2013,Src,SrcB,23<br>
Card2,Sources,12/31/2013,Src,SrcC,11<br>
Card2,Sources,12/31/2013,Src,SrcD,10<br>
Card2,Sources,12/31/2013,Src,SrcE,23<br>
Card2,Sources,12/31/2013,Src,SrcF,24<br>
Card2,Sources,12/31/2014,Item,Item21,N<br>
Card2,Sources,12/31/2014,Item,Item22,N<br>
Card2,Sources,12/31/2014,Item,Item23,N<br>
Card2,Sources,12/31/2014,Item,Item24,Y<br>
Card2,Sources,12/31/2014,Item,Item25,N<br>
Card2,Sources,12/31/2014,Src,SrcA,45<br>
Card2,Sources,12/31/2014,Src,SrcB,55<br>
Card2,Sources,12/31/2014,Src,SrcC,20<br>
Card2,Sources,12/31/2014,Src,SrcD,12<br>
Card2,Sources,12/31/2014,Src,SrcE,20<br>
Card2,Sources,12/31/2014,Src,SrcF,19<br>
Card2,Sources,12/31/2015,Item,Item21,N<br>
Card2,Sources,12/31/2015,Item,Item22,N<br>
Card2,Sources,12/31/2015,Item,Item23,Y<br>
Card2,Sources,12/31/2015,Item,Item24,Y<br>
Card2,Sources,12/31/2015,Item,Item25,Y<br>
Card2,Sources,12/31/2015,Src,SrcA,12<br>
Card2,Sources,12/31/2015,Src,SrcB,11<br>
Card2,Sources,12/31/2015,Src,SrcC,10<br>
Card2,Sources,12/31/2015,Src,SrcD,18<br>
Card2,Sources,12/31/2015,Src,SrcE,49<br>
Card2,Sources,12/31/2015,Src,SrcF,30 </p>
JFreeman
<p>Alright, i've got something that is about 99% of the way to what you drew out in the first post. There are only a couple of minor alignment issues with border lines that need to be addressed still.</p>
<p> </p>
<p>What I did was create an outer table with a group for the card name. Within the group header row of this table is a grid that contains all of the other content. Within this grid are various crosstabs and labels with filtering applied to conform to your layout requests. The report can be a little bit tricky to read in the editor due to the layout but once you get the hang of what is where it's not too bad. I also had to add a bit of scripting to handle the Y/N values.</p>
<p> </p>
<p>Take a look at the attached sample report/screenshot and let me know if you have any questions.</p>
bentotdecruz
<p>Thanks a lot. Yes, there are a lot of border alignment probably because of the padding since you put those crosstabs inside the grid. I'll explore more on this. Thanks again for the idea.</p>
JFreeman
<p>You're welcome.</p>
<p> </p>
<p>Dealing with all the padding and border lines for all of the crosstabs is a bit tricky due to the complexity of the structure but should be possible to get all lined up with some more tweaking.</p>
<p> </p>
<p>Let us know if you have any additional questions.</p>