List item
I attached my query below and I need to filter the data based on below condition. The output is display only when the parameter is passed from the respective table.
SELECT
(SELECT 'Static Field') AS account_type,
(SELECT
COALESCE(SUM(ln.amount), 0)
FROM
ln
WHERE
AND ln.brch_id = $P{PARA_ID}
AND ln.date < $P{PARAM_FROM_DATE}
AND $P{PARA_Account_Type} = 'Static Field') AS debit_amount,
(SELECT
COALESCE(SUM(pd.paid_amount), 0)
FROM
pd,
ln
WHERE
pd.loan_id = ln.id AND ln.brch_id = $P{PARA_ID}
AND pd.paid_date < $P{PARAM_FROM_DATE}
AND $P{PARA_Account_Type} = 'Static Field') AS credit_amount
having
account_type = 'Static Field'
Output should be: I expect the sum of the values based on above different condition only when the respective parameter is passed if it does not passed the respective parameter it will not display the row