COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: anilkumar on 13 Oct 2009 07:16:17 AM

Title: last day ofevery month(its very very urgent) please help me out
Post by: anilkumar on 13 Oct 2009 07:16:17 AM
HI guys

in my report i need one data item like'last day'  of every month

that means like  if jan=31-01-2009
                           feb=28-02-2009----
                            dec=31-12-2009


but reports are based on  powerplay cubes

advance thanks

Regards
ANIL K.MARRI
Title: Re: last day ofevery month(its very very urgent) please help me out
Post by: laxmanrao83 on 13 Oct 2009 07:40:40 AM
Hi ,

We have function like Closing period.
try this.


Title: Re: last day ofevery month(its very very urgent) please help me out
Post by: anilkumar on 13 Oct 2009 09:10:05 AM
helo laxman

send full detail query, month should change dynomically, i want use this data item in calculation.

iam in confusion.
Title: Re: last day ofevery month(its very very urgent) please help me out
Post by: Thermos on 13 Oct 2009 11:07:40 AM
I'm not sure of what you are asking exactly but you can get last day of the month like this....
_add_days (_first_of_month (current_date), -1)

if you want it based on a field replace current_date with that field.  does that help at all?
Title: Re: last day ofevery month(its very very urgent) please help me out
Post by: anilkumar on 13 Oct 2009 11:53:31 PM
hi thermos

thanks for reply. but i want  to use this months in prompt

like if select september  in prompt  it has to calculate jan to aug(243 days)
                  august       in prompt   it has  to calulate jan to jul(212 days)


my formula like(VOL (MM)) >= 0.01 ) then ( POOL (M) + RAC (M) ) * 360 ) / ( VOL (MM) * Month Last Day ) ) else ( 0 ) )


here month last day  means .
september  in prompt  it has to calculate jan to aug(243 days)
august       in prompt   it has  to calulate jan to jul(212 days)
october       in prompt   it has to calculate jan to sep (273 days)

help me out

regards
anil
Title: Re: last day ofevery month(its very very urgent) please help me out
Post by: Lee Drake on 14 Oct 2009 07:43:32 AM
If the prompt could return a date value, you could use _day_of_year(_last_of_month([Prompt Date]))

If the prompt returns a string, it may be possible to turn that into a date and use something similar to the above formula.
Title: Re: last day ofevery month(its very very urgent) please help me out
Post by: anilkumar on 15 Oct 2009 02:14:38 AM
i  resolved the issue

Thanks for every one for helping

Regards
ANIL K .MARRI