Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Reset Columns in CrossTab Post Reply Post New Topic
Author Message
slamyers
Newbie
Newbie
Avatar

Joined: 09 May 2013
Online Status: Offline
Posts: 4
Quote slamyers Replybullet Topic: Reset Columns in CrossTab
     Posted: 10 May 2013 at 2:38am
i have created a cross tab report of procedures performed within our Fiscal year.  The data selection is fine but I need the cross tab to be grouped bi-weekly.  Our Fiscal year starts July 1.  They want the columns to start July 1 to July 14 and so on.  But the cross tab is still going off of calendar year.  The first column is June 24 to July 7, even though the data is only pulling for what was doen July 1 and on.  How can I reset the column date so it groups them biweekly starting July 1.  This corresponds with our payroll so they need to know procedures done within a pay period.
itworkhorse
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 May 2013 at 3:24am
you could consider doing a date diff of day from 7-1 and then dividing that by 14 and rounding up so the reults would be pay periods of 1 through today and then group on that.
IP IP Logged
slamyers
Newbie
Newbie
Avatar

Joined: 09 May 2013
Online Status: Offline
Posts: 4
Quote slamyers Replybullet Posted: 10 May 2013 at 7:14am
I thought I needed two different date fields  for a datediff?  I only have one date (date of service) I need them grouped on that.  Sorry very new to the more complex formulas and just self taught Crystal.
itworkhorse
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 May 2013 at 8:01am
i assume you are using a date field value to set yuour current CT grouping up on.That would be the otyher field to do the date diff against the 7/1/2012.
something like:
 
ceiling(datediff('d',date(2012,6,30),{table.date}),14)/14
 
IP IP Logged
slamyers
Newbie
Newbie
Avatar

Joined: 09 May 2013
Online Status: Offline
Posts: 4
Quote slamyers Replybullet Posted: 10 May 2013 at 8:13am
I will try that.  I used this and it works great but i have to group biweekly and this groups weekly. 

DateTimeVar StartDate := {Charges.Charge Date};
Numbervar WeekStart :=1;
Date (StartDate) - DayOfWeek (StartDate) + WeekStart
- (if DayOfWeek (StartDate) < WeekStart then 7)

itworkhorse
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 May 2013 at 9:08am
the code i gave you should return 1 for the first 14 days, 2 for the second 14 days, etc. basically just numbering your pay periods.
 
IP IP Logged
slamyers
Newbie
Newbie
Avatar

Joined: 09 May 2013
Online Status: Offline
Posts: 4
Quote slamyers Replybullet Posted: 10 May 2013 at 9:11am
Thanks, worked.  Used FLOOR so it would start at the first pay period of the fiscal year.
itworkhorse
IP IP Logged
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