Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Build a chart showing current month only Post Reply Post New Topic
Author Message
Torkem
Newbie
Newbie


Joined: 06 Nov 2011
Online Status: Offline
Posts: 2
Quote Torkem Replybullet Topic: Build a chart showing current month only
    Posted: 07 Nov 2011 at 1:31am
Hi !

I've a report that is selecting data from last 2 year in order to compare last and current year's activity.

But in that report, I've been asked to have a chart that is showing a TOP5 for current month only.

Does anyone knows how to do that ?
Thx for the help !
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Nov 2011 at 4:19am
if you group on datefield set to month descending you can insert a chart in the group header. suppress the chart section with
NOT(datefield in monthtodate)
in the chart use TopN option to show top 5 only.
IP IP Logged
Torkem
Newbie
Newbie


Joined: 06 Nov 2011
Online Status: Offline
Posts: 2
Quote Torkem Replybullet Posted: 07 Nov 2011 at 9:36pm
Thanks for your answer, but I forgot to mention that the report I'm building has to fit in one section only (all charts are in the report header)

Isn't there a way to do that without having to put it in a group section ? (could running total be a solution ?)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Nov 2011 at 4:27am
well I guess you can try and "trick" the process but there is a minor risk involved.
create a formula field to zero out all of the vlaues that are not from this month called 'current_month_values' (or whatever)
if {table.datefield} in monthtodate then {table.valuefield} else 0
 
place the chart in the report header
on change of select your top 5 field and set the TopN to top 5
in the show value use the 'current_month_values' formula field
 
The risk here is that if you do not have at least 5 different on change of fields with a total >0 then the zeroed out fields frm other months come into play and will appear in the chart
 
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.000 seconds.