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)
Stockmarket format table reports
ryijynshui
<p>Hi all, I'm very new to BIRT reports and came via SpagoBI. I'm a DBA with a bit of programming understanding, but I believe I am now out of my depth.</p><p> </p><p>I have a table that displays rows of data of visitors to a website. Its the usually type of data;</p><pre class="_prettyXprint _lang-nocode">+
+|DATE | NO_VISITORS | PAGES_VIEWED | BANDWIDTH_USED | PEAK_HOUR|+
|
|
|
|
||2014-04-04 | 350100 | 100400 | 85 | 2140 ||2014-01-03 | 300100 | 510000 | 125 | 2140 ||2014-01-02 | 120000 | 450000 | 87 | 2230 ||2014-01-01 | 200000 | 650000 | 78 | 2030 |+====================================================================+</pre><p>I would like to mimic an Excel spreadsheet that uses Conditional Formatting rules and arrow icons, but I would settle for changing the background colour of each cell to one of three colours: red for decrease, green for increase and blue for no change.</p><p> </p><p>As for the data, the latest figures always appear at the top, so the data from the top line is compared only with the data from the previous day i.e. so the 4th Jan is compared with the 3rd Jan, the 3rd Jan with the 2nd Jan, etc.</p><p> </p><p>I have been googling for over a week now and picked up a lot but I suspect this will require Java or Javascript, having already investigate using Highlights. Highlights was useful for alternating background colours for each row, however, if I missed something do feel free to point it our to me.</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p><p> </p><p>You will need a bit of scripting and some data set manipulation to do it. I have attached a report based on Classic Models to show you how it works.</p><p> </p><p>First, I have created 2 data sets Current and CurrentMinusOneDay that return the same data, number of sales by date. In each data set I added a computed column that I can use to join the two data sets in order to get the amount sold on one day and on the previous day on one line. The join data set is called Final Data Set and is used to display the data in the table.The computed column is based on two variables, counterCurrent and counterMinusOneDay defined in the beforeFactory method of the report.</p><p> </p><p>The table shows the date and the sales value. The highlight rules have been created by comparing the Current sales with the Current Minus One Day sales. Notice that I have added a condition to test if I am on the last row (row["CurrentMinusOneDay::SALES"] != null) to make sure I don't highlight the last row of the table.</p><p> </p><p>Hope this helps!</p><p> </p><p>P.</p>
ryijynshui
<p>Hi Pricher,</p><p> </p><p>Thanks for replying and the file. I'll be checking it out.</p><p> </p><p>I thought about involving a second data set as you suggested, but just wondered if there was another way, using BIRT, that I missed. Another idea I had was to create another table and do some backend processing with SSIS. I could then build a join, create a data set and format the data in BIRT.</p><p> </p><p>Cheers</p><p>RJS</p>
pricher
<p>There are many ways to skin a cat! The example I provided was based on the data you posted. If you can do it at the database level, go that way: database engines are better at processing joins on big data sets.</p><p> </p><p>P.</p>