Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to count all previous three year months
01-03-2011 from to till date how many months please help me
Thanks in Advance
Niranjan
See the attached sample for a way in the front end without any data from back end.
edit: My sample takes year as input, you can modify accordingly for date input.
Please Find attached QVW will help you lots.
Vikas
Try this
=count({<Date={'>=$(=Monthstart(Max(Date),-2))<=$(=Date(Max(Date)))'},Month=>}ID)
Please check enclosed file..
Create 6 variables:
yearLess2start = Makedate(year(today())-2, month(today()), 1);
yearLess2end = Makedate(year(today())-2, month(today()), day(today());
yearLess1start = Makedate(year(today())-1, month(today()), 1);
yearLess1end = Makedate(year(today())-2, month(today()), day(today());
yearCurrentstart = Makedate(year(today()), month(today()), 1);
yearCurrentend = Makedate(year(today()), month(today()), day(today());
Then your expressions must be:
for the 2012: sum({$ <mydate = {'>=$(yearLess2start)<=$(yearLess2end)'}>} value)
for the 2013: sum({$ <mydate = {'>=$(yearLess1start)<=$(yearLess1end)'}>} value)
for the 2014: sum({$ <mydate = {'>=$(yearCurrentstart)<=$(yeaCurrentend)'}>} value)
Hope it helps
Hi manish,
Is it possible to get with to dates 01-03-2011 to 12-03-2014
In between using set analysis with out writing any script
Best Regards,
Niranjan
Hi Niranjan,
Check this thread hope it helps you.
Calculating Months difference between two dates
Regards,
Jagan.
Hi Niru
I always define a continues month number in my script. So if your application starts with 2011 data I calculate the number by :
(Year(Date) - 2011 ) * 12 + Month(date) so it is very simpel to make calculations in your set analysis f.i :
Sum ({< PERIODKEY = {'> $(=$(vcurrYearMonthnum)-24) <= $(=$(vcurrYearMonthnum)-12) ' } ,F_PPP = {1,2} , T_PPP={3} >} COUNTER)
vcurrYearMonthnum has been calculated as mentioned above
Good luck
See the attached sample for a way in the front end without any data from back end.
edit: My sample takes year as input, you can modify accordingly for date input.
Hi Tresesco,
Thanks for your replay,
but im using 03-02-2011 format how can give this date
Thanks you so much
Best Regards,
Niranjan