KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Do you have LeftJoin process? #3438

Open Eugene opened this topic on 1 day ago - 2 comments

Eugene commented 1 day ago

To use like $leftjoin = new LeftJoin($user_source,$purchase_source,array("id"=>"user_id"));

Eugene commented 1 day ago

Ahh... I just noticed that I asked the same question in 2019

https://www.koolreport.com/forum/topics/970

It looks like we do not have it till now. Okeee....

Eugene commented 1 day ago

Could you tell me please where I am wrong.

I used to do the following:

     $join1 = new Join($spoiled_tmp, $cons1, array("item_id" => "itemId"));
     $join2 = new Join($join1, $cons2, array("item_id" => "itemId"));
     $join2->pipe($this->dataStore('spoiled'));

It worked but I need Left Join in this case so I added ->pipe($this->dataStore('*****')) to the code where I calculate $spoiled_tmp, $cons1 and $cons2 to get spoiled_tmp, cons1 and cons2 Datastores;

and then I do

$joined= $this->dataStore('spoiled_tmp')
            ->leftJoin($this->dataStore('cons1'), array('item_id' => 'itemId'))
            ->leftJoin($this->dataStore('cons2'), array('item_id' => 'itemId'));
$joined->pipe($this->dataStore('spoiled'));

but I got the empty table where the previous code worked.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None