Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8578

Re: How to calculate last 12 months, 6 months, 3 months data in report

$
0
0

Hi Remi,

 

To start your main report to return the months and group by months.  This gives you your first level.

 

In the Group Header, add a subreport and link it to the group.  The subreport will return records for the last 12 months.

 

Use a running total to get your numbers for 12 months, 6 months and 3 months.  Something like:

 

WhilePrintingRecords;

NumberVar 12MnthTtl;

 

If Month ({table.DATEFIELD}) In [(Month (CurrentDate) - 11) to Month (CurrentDate)] Then

   12MnthTtl :=  12MnthTtl + {table.myAmount};

 

Do a similar formula for the 6 and 3 month.  Then display the totals in the Report Footer.  This will give you your 3 columns with the data you want.

 

Good luck,

Brian


Viewing all articles
Browse latest Browse all 8578

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>