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)
add different row total with one measure
aigle83
Hello,
i have a questions, and a samples, and in a cross a tab i want to display the response of each question by sample (as show my report attached).
each response has 'Oui' or 'Non' as value.
for total row, i want to display the total of 'Oui' and the total of 'Non', so i add a second measure, to have two totals, i customize the expression of the two totals, and i have the result that i want.
my problem is that i dont know how to have the percent of 'Oui' i.e total('Oui')/(total('Oui')+total('Non')).
i hope that i have explain my problem well.
i need your help.
Thanks
Find more posts tagged with
Comments
mwilliams
Hi aigle83,
What version of BIRT do you have and can I run this report? Or does it use your data I don't have access to?
aigle83
Hello mwilliams,<br />
Thank you for reply, the version of birt that i have is 2.5.1.<br />
My database is : (sorry i coudn't attached the sql file) <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
-- MySQL Administrator dump 1.4
--
--
-- Server version 5.0.45-community-nt
/*!40101 SET
@CHARACTER_SET_CLIENT
*/;
/*!40101 SET
@CHARACTER_SET_RESULTS
*/;
/*!40101 SET
@COLLATION_CONNECTION
*/;
/*!40101 SET NAMES utf8 */;
/*!40014 SET
@UNIQUE_CHECKS
, UNIQUE_CHECKS=0 */;
/*!40014 SET
@FOREIGN_KEY_CHECKS
, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET
@SQL_MODE
, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
--
-- Create schema birtbd
--
CREATE DATABASE IF NOT EXISTS birtbd;
USE birtbd;
--
-- Definition of table `echantillon`
--
DROP TABLE IF EXISTS `echantillon`;
CREATE TABLE `echantillon` (
`idEchant` int(10) unsigned NOT NULL auto_increment,
`numEchant` varchar(45) NOT NULL,
PRIMARY KEY (`idEchant`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `echantillon`
--
/*!40000 ALTER TABLE `echantillon` DISABLE KEYS */;
INSERT INTO `echantillon` (`idEchant`,`numEchant`) VALUES
(1,'N? 01'),
(2,'N? 02'),
(3,'N?03');
/*!40000 ALTER TABLE `echantillon` ENABLE KEYS */;
--
-- Definition of table `questions`
--
DROP TABLE IF EXISTS `questions`;
CREATE TABLE `questions` (
`idQuestion` int(10) unsigned NOT NULL auto_increment,
`detailQuest` varchar(45) NOT NULL,
`reponse` varchar(45) NOT NULL,
`idEchant` int(10) unsigned NOT NULL,
PRIMARY KEY (`idQuestion`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `questions`
--
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
INSERT INTO `questions` (`idQuestion`,`detailQuest`,`reponse`,`idEchant`) VALUES
(1,'question 01','Oui',1),
(2,'question 02','Oui',1),
(3,'question 03','Non',1),
(4,'question 01','Non',2),
(5,'question 02','Non',2),
(6,'question 03','Oui',2),
(7,'question 01','Oui',3),
(8,'question 02','Non',3),
(9,'question 03','Oui',3);
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
/*!40101 SET SQL_MODE=
@OLD_SQL_MODE
*/;
/*!40014 SET FOREIGN_KEY_CHECKS=
@OLD_FOREIGN_KEY_CHECKS
*/;
/*!40014 SET UNIQUE_CHECKS=
@OLD_UNIQUE_CHECKS
*/;
/*!40101 SET CHARACTER_SET_CLIENT=
@OLD_CHARACTER_SET_CLIENT
*/;
/*!40101 SET CHARACTER_SET_RESULTS=
@OLD_CHARACTER_SET_RESULTS
*/;
/*!40101 SET COLLATION_CONNECTION=
@OLD_COLLATION_CONNECTION
*/;
/*!40101 SET CHARACTER_SET_CLIENT=
@OLD_CHARACTER_SET_CLIENT
*/;
</pre>
Thanks.<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74086" data-time="1298940140" data-date="28 February 2011 - 05:42 PM"><p>
Hi aigle83,<br />
<br />
What version of BIRT do you have and can I run this report? Or does it use your data I don't have access to?<br /></p></blockquote>
mwilliams
I will just make an attempt to help without being able to run the report.
What I think you're meaning is that you have a crosstab column that has two values. You want to add them separately though and figure out a percent of total values in the column? If this is correct, you could simply create a couple variables to keep track of the individual totals in the crosstab and then just use a grid and dynamic textboxes in your grand total area to create your own totals and percentages. Let me know.