Jump to content

need help on cummulative data


shivareddyk

Recommended Posts

hi .....

 

I am writing query like this for calculating monthly wise data values.

select x.*,y.Impairment from (SELECT  a.finyr, a.finpr,b.grptyp,sum(case when  b.grptyp = 'PL1' then locbal else 0 end) TotalIncome,
sum(case when b.grptyp='PL2' or b.grptyp='PL3' then locbal else 0 end) TotalExpenses,
sum(case when  b.grptyp = 'PL4' then locbal else 0 end) Taxation,
sum(case when  b.grptyp = 'BSS' then locbal else 0 end) Equity
 FROM D_S_GL06MAST a, D_S_GL04SGSTR b
WHERE a.compcd = b.compcd
AND    a.glkey = b.glkey and  a.finpr=$P{reportdate}
group by finyr,finpr) x,(SELECT a.finyr, a.finpr, sum(locbal) Impairment FROM D_S_GL06MAST a, D_S_GL04SGSTR b, S_CF92PRGL c
WHERE a.compcd = b.compcd
AND    a.glkey = b.glkey
AND     b.accd = c.glcd
AND     b.fccd = c.fccd
AND   c.crline = 'LN'
AND  c.glfld IN ('GL11', 'GL37', 'GL38', 'GL50', 'GL51')and a.finpr=$P{reportdate}
group by finyr,finpr) y where x.finyr=y.finyr and x.finpr=y.finpr

that works fine,give result as

our input as 1 it gives January data

                        2 it gives February data,

 

BUT........I need cummulative data......

i put in i-reports settings "sum" in calculation type.but i did not get u cummulative data,any one can help for me......

 

 

Thanks in advance....

 

shiv a

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...