pentaho - MySQL - Calculate % from two tables using sub-querys -
i'm new this, had no training @ , didn't cover in uni. bare me.
it's simple query pulls data, counts number of results , displays total user. using sub-queries , pulling 2 different tables these results.
select count(trans_station), trans_station cuesheet_tx_dates trans_station = "his" , txdate between "15-01-01" , "15-01-31"
^this returns data within date , channel code
select count(*) hisr cuesheet_tx_dates td inner join cuesheets s on td.cuesheets_id = s.id td.txdate between '2015-01-01' , '2015-01-31' , td.trans_station = 'his' , s.status = 'c';
^this returns completed data within date , channel code
i need know how calculate percentage of completed data against data. using pentaho report designer ce, mysql db, appreciated.
you can create formula result of query using "singlevaluequery" function. example, let's create formula called "transstationamountformula". content of formula should be:
=singlevaluequery("query_to_get_amount_of_trans_stations")
following same pattern, can create formulas (and other queries) numbers need make calculations.
hope helps.
Comments
Post a Comment