Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: MTD and YTD Post Reply Post New Topic
Author Message
CrystalGirl
Newbie
Newbie


Joined: 22 Feb 2015
Online Status: Offline
Posts: 36
Quote CrystalGirl Replybullet Topic: MTD and YTD
    Posted: 13 Mar 2015 at 2:22pm
Hi all,

Anyone can help me to do a formula to calculate the YTD?

I am creating a yearly revenue report. There are three columns from one table in the same datasource. Let's called it "Accounting". The three columns are: Months, Debit and Credit.

Here are "Accounting" table data:

Month      Debit     Credit
01/2015    500        400
02/2015    600        300
03/2015    400        200
04/2015    500        200
05/2015    400        200
06/2015    600        100
07/2015    400        300
08/2015    500        200
09/2015    600        400
10/2015    500        100
11/2015    600        500
12/2015    400        200

The Revenue is: Debit - Credit, so here are the Revenue on every month.(MTD)
01/2015: 100
02/2015: 300
03/2015: 200
04/2015: 300
05/2015: 200
06/2015: 500
07/2015: 100
08/2015: 300
09/2015: 200
10/2015: 400
11/2015: 100
12/2015: 200

Here the YTD report I want to do:
Month       MTD    YTD
01/2015:    100    100
02/2015:    300    400
03/2015:    200    600
04/2015:    300    900
05/2015:    200    1100
06/2015:    500    1600
07/2015:    100    1700
08/2015:    300    2000
09/2015:    200    2200
10/2015:    400    2600
11/2015:    100    2700
12/2015:    200    2900

Anyone know how to do the formula?

Thank you all
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Mar 2015 at 4:09am
one formula will be your MTD
table.debit-table.credit
the YTD is a Running Total (or shared variable formulas) using the MTD formula
 
RT
Name = YTD
type = sum
evaluate=for each record
reset=never
place on details to see rolling value and also in Report footer to see final outcome. will not work in a header.


Edited by DBlank - 16 Mar 2015 at 4:13am
IP IP Logged
CrystalGirl
Newbie
Newbie


Joined: 22 Feb 2015
Online Status: Offline
Posts: 36
Quote CrystalGirl Replybullet Posted: 16 Mar 2015 at 4:00pm
Hello DBlank,

Thank you for the response and your time. The problem is, I have to run the report every month. So for example, if I run January report, I have YTD for January, but if I run February report, I only get the February running YTD. So, how do I include the YTD for January on the February report?

So basically when I run the report, I only run for one month. I want to be able to make my YTD dynamic depending what month I choose. If I choose, March, then I should have YTD from January, February and March added but right know, my YTD amount is based on the period I choose. If I choose March, my current YTD is the YTD amount of March only.

I really appreciated your time and help DBlank. Do you have any idea how to solve this?

Edited by CrystalGirl - 17 Mar 2015 at 2:07pm
IP IP Logged
CrystalGirl
Newbie
Newbie


Joined: 22 Feb 2015
Online Status: Offline
Posts: 36
Quote CrystalGirl Replybullet Posted: 16 Mar 2015 at 4:04pm
updated. See above response.

Edited by CrystalGirl - 17 Mar 2015 at 2:08pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Mar 2015 at 4:54am
you have to "run it" for the entire year of data.
If you want your MTD to only show one month then you handle that in conditional display of the overall record set.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.