DataSets and empty reference parameters

3
I have a dataset with 4 parameters which refer to 4 Mendix objects. 2 of the Mendix object references are always set in the database, and 2 are optional. It seems like the data set only contains data with all 4 parameters set. How to also get the data with an empty reference? FROM "Order".OrderLine AS OL INNER JOIN OL/"Order".OrderLine_Order/"Order"."Order" as O WHERE O/"Order".Order_Supplier = $objSupplier AND O/"Order".Order_ProductGroup=$objProductGroup AND O/"Order".Order_Customer=$objCustomers AND O/"Order".Order_Agent=$objAgent AND (OL/ProductionStatus='P' OR OL/ProductionStatus='S') GROUP BY OL.SupplyChainMonth SELECT OL.SupplyChainMonth as MonthName, SUM(OL/Pieces) as PiecesSupplyChain, ORDER BY MonthName $objSupplier and $objProductGroup are references to Mendix objects which are always set, $objAgent and $objCustomers are references to Mendix objects which can be set but also can be empty
asked
2 answers
1

I think you need something like (don't know the exact syntax top of my head)

... AND O/"Order".Order_ProductGroup=$objProductGroup ...

->

.. AND ( (O/"Order".Order_ProductGroup=$objProductGroup ) or ($objProductGroup = empty and O/"Order".Order_ProductGroup = empty)) ...
answered
0
FROM "Order".OrderLine AS OL
INNER JOIN OL/"Order".OrderLine_Order/"Order"."Order" as O
WHERE  O/"Order".Order_Supplier = $objSupplier AND O/"Order".Order_ProductGroup=$objProductGroup AND O/"Order".Order_Customer=$objCustomers AND O/"Order".Order_Agent=$objAgent
AND (OL/ProductionStatus='P' OR OL/ProductionStatus='S')
GROUP BY OL.SupplyChainMonth
SELECT 
OL.SupplyChainMonth as MonthName,
SUM(OL/Pieces) as PiecesSupplyChain,
ORDER BY MonthName

$objSupplier and $objProductGroup are references to Mendix objects which are always set, $objAgent and $objCustomers are references to Mendix objects which can be set but also can be empty

answered