Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: DayOfWeek In Cross-Tab Report Post Reply Post New Topic
Author Message
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Topic: DayOfWeek In Cross-Tab Report
     Posted: 03 Aug 2014 at 11:01pm
Morning all,

I currently have a simple Cross-Tab report created showing the CPU usage of a system over the last week; with a graph also displayed.

What I'd like to do is create a column in the cross-tab (or a formula in Select Expert that does the same thing) that shows the day of the week derived from the date field. The Cross-Tab is setup as follows:

Column 1: Date/Time field (DD/MM/YYYY HH:MM)
Column 1: CPU Usage

I have tried using a Calculated Member column (which keeps saying my formula (below) is incorrect) and also writing the below formula in Formula Fields and dragging it next to the Cross-Tab fields (the formula works but it doesn't attach itself to the cross-table).

Once I can get this working I will then add the other days...

 If DayOfWeek ({System1.DATE_TIME})=1 Then

        "Sunday"
Else
        ""
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Aug 2014 at 9:19am

If you want to group your MOnday's together across weeks you need to create a formual field to extract the day of the day of the week from the datetime field.

Once you have that you can dispaly the name in a few ways.
If the field is still a datetime field just
right click on it
select format text
select common tab
select display string formula
use
weekdayname(datepart('w',currentfieldvalue))
 
if you are already grouping on the weekday part use
weekdayname(currentfieldvalue)
 
 
 
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 04 Aug 2014 at 9:59pm
Hi DBlank,

That has worked perfectly on the crosstab report I have, thank you!

What I would like, ideally, is to have the date and a separate column showing 'Monday', 'Tuesday' etc. My current (limited) knowledge with Crosstabs can't add a second column with the date field in, but is it possible? Then I can apply this formula to the second date field?
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