I have created a query to get actual,budget,encumbrance amount.but encumbrance amount is coming wron
HI,
I have created a query to get actual,budget,encumbrance amount.but encumbrance amount is coming wrong,even with the same query actual and budget amounts are coming fine,query pfb
SELECT concatenated_segments, period_name, budget, encumbrance, actual,
(nvl(budget,0) - nvl(encumbrance,0) - nvl(actual,0)) available
FROM (SELECT gck.concatenated_segments, b.period_name,
TO_NUMBER
(NVL (SUM (DECODE (b.actual_flag,
'B', ( NVL (b.begin_balance_dr, 0)
- NVL (b.begin_balance_cr, 0)
+ ( NVL (b.period_net_dr, 0)
- NVL (b.period_net_cr, 0)
)
)
)
),
0
)
) budget,
TO_NUMBER
(NVL (SUM (DECODE (b.actual_flag,
'E', ( NVL (b.begin_balance_dr, 0)
0