Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data is missing #34

Open
vivianyeoh opened this issue Jul 29, 2019 · 1 comment
Open

Data is missing #34

vivianyeoh opened this issue Jul 29, 2019 · 1 comment

Comments

@vivianyeoh
Copy link

I trying to load data from sql and print on the website with koolreport. I have 5 output with this sql on phpmyadmin:
SELECT NUMOFNG, NUMOFATTEMPT, AVGTACTTIME, MODULE, RESULT FROM TTLTVNG WHERE RESULT='NG' AND MODULE='24' UNION ALL SELECT 'OK 1',SUM(NUMOFATTEMPT), AVG(AVGTACTTIME), MODULE, RESULT FROM TTLTVNG WHERE RESULT='OK' AND MODULE='24'

but the graph only print 3 of it every time.

Number of NG Total TV Average TIME(s)
1 1 30.10
3 3 6.93
OK 1 357 9.05

my code:
protected function setup()
{
$this->src('sakila_rental')
->query("SELECT NUMOFNG, NUMOFATTEMPT, AVGTACTTIME, MODULE, RESULT FROM TTLTVNG WHERE RESULT='NG' AND MODULE='24' UNION ALL SELECT 'OK 1',SUM(NUMOFATTEMPT), AVG(AVGTACTTIME), MODULE, RESULT FROM TTLTVNG WHERE RESULT='OK' AND MODULE='24'")

    ->pipe(new Group(array(
        "by"=>"NUMOFNG"
    )))
    ->pipe(new Group(array(
        "by"=>"NUMOFATTEMPT"
    )))
    ->pipe(new Group(array(
        "by"=>"AVGTACTTIME"
    )))
    ->pipe($this->dataStore('sale_by_month'));
    
     print_r(array(
    "dataSource"=>$this->dataStore('sale_by_month'),
    "columns"=>array(
        "NUMOFNG"=>array("label"=>"Number of NG", "type"=>"string"),
        "NUMOFATTEMPT"=>array("label"=>"Total TV"),
        "AVGTACTTIME"=>array("label"=>"Average TIME(s)","type"=>"number","decimals"=>2)
    ),
    "cssClass"=>array(
        "table"=>"table table-hover table-bordered"
    )
));

view.php

<div style="margin-bottom:50px;">
<?php
ColumnChart::create(array(
    "dataSource"=>$this->dataStore('sale_by_month'),
    "columns"=>array(
        "NUMOFNG"=>array("label"=>"Number of NG", "type"=>"string"),
        "NUMOFATTEMPT"=>array("label"=>"Total TV"),
        "AVGTACTTIME"=>array("label"=>"Average TIME(s)","type"=>"number","decimals"=>2)
    )
));
?>
</div>
<div style="margin-bottom:50px;">
<?php
    
    
    
    
Table::create(array(
    "dataSource"=>$this->dataStore('sale_by_month'),
    "columns"=>array(
        "NUMOFNG"=>array("label"=>"Number of NG", "type"=>"string"),
        "NUMOFATTEMPT"=>array("label"=>"Total TV"),
        "AVGTACTTIME"=>array("label"=>"Average TIME(s)","type"=>"number","decimals"=>2)
    ),
    "cssClass"=>array(
        "table"=>"table table-hover table-bordered"
    )
));
?>
</div>

How did this happen? What can I do to solve it?

@koolreport
Copy link

I see that you used the Group process and your data could be grouped into 3 rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants