Print Page | Close Window

YTD Calculations using Current Fields

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3826
Printed Date: 19 May 2024 at 1:32am


Topic: YTD Calculations using Current Fields
Posted By: rusty
Subject: YTD Calculations using Current Fields
Date Posted: 28 Jul 2008 at 5:28pm
I have a report with Date Range parameters [From and To]. Also, the report has 4 fields per employee - Current hours, Current Amount, YTD Hours and YTD Amount. When I enter the date range, it is supposed to pull all of these 4 fields. It pulls Current Hours and Current Amount fields for the given Date Range.
Issue - I am supposed to use the SAME fields as Current Hours and Current Amount and calculate YTD amount and YTD hours. I am not sure how to do this. Can someone please help me to do this? Thanks



Replies:
Posted By: hilfy
Date Posted: 29 Jul 2008 at 2:36pm

If your parameters are limiting the data retrieved to just the data between the two parameter dates, you can't get the YTD data from that table directly.  If there's only one record per employee in the date range, it would be fairly easy to pull in a second copy of the table and set a filter on it for the current year's data.  However, I suspect that you can have multiple records per employee for the date range, correct?

What type of database are you using?  How familiar are you with SQL?  There is a way to do this using a Command instead of the tables, but you need to know some SQL in order to be able to do this.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window