Hi KoolReport,

I had done as below using an empty column, then use formatValue to do calculation for values from different queries. I am not sure whether this way is correct, I got the result, however, it only show the first calculated row value in all rows.

I have tried playing around with [0], and I understood that this is to show array. How do I correct this to show respective values in their respective rows?

I hope you could help me with this.

Table::create(array(
        "dataStore"=>$this->dataStore('A'),
        "showHeader"=>false,
        "columns"=>array(
            "empty_column"=>array(
                "formatValue"=>function($value)
                {
                    return number_format($this->dataStore("A")->data()[0]["sales"]*100/$this->dataStore("B")->data()[0]["totalsales"],2)."%";
                },
            ),
        "cssClass"=>array(
            "table"=>"table table-bordered table-condensed ",
        ),

        ));
        
        ?> 

Appreciate your help.

Thank you very much.