$this->getSelect()->join(
["address" => "sales_order_address"],
'main_table.entity_id = address.parent_id AND address.address_type = "shipping"',
array('region')
)->joinLeft(
["so" => "sales_order_tax"],
'main_table.entity_id = so.order_id',
array('sgst' => strcmp('address.region','Maharashtra') == 0 ? new \Zend_Db_Expr('SUM(amount)/2') : new \Zend_Db_Expr(0),'cgst' => strcmp('address.region','Maharashtra') == 0 ? new \Zend_Db_Expr('SUM(amount)/2') : new \Zend_Db_Expr(0),'igst' => strcmp('address.region','Maharashtra') != 0 ? new \Zend_Db_Expr('SUM(amount)') : new \Zend_Db_Expr(0),'amount' => new \Zend_Db_Expr('SUM(amount)'))
)
->group('so.order_id');
I need to compare the region in the shipping address and based on that i need to set the sgst, cgst and igst value in the sales order grid. what is the correct syntax to compare.