Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Range Value calculation and default Post Reply Post New Topic
Author Message
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Topic: Range Value calculation and default
     Posted: 02 Jan 2015 at 6:18am
I'm trying to use a formula to calculate par levels based on a date range. I have a formula that is calculating the date range:

"global numbervar numberofdaysofreport;

Maximum({?Date Range}) - minimum({?Date Range})

and a formula to calculate the par:

({PAR_LEVEL} * Count ({@SDate}, {ITEM}))/{@numberdaysofreport}

The problem I have is when I only enter a date range of 1 day so view other information on the report. How can I edit my formula to that if days of the report is zero to make that value 1.

Any help would be great.

Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Jan 2015 at 7:47am
based on your description it would seem like that value is always off by one day so why not just add 1 to it...
 
 
((Maximum({?Date Range}) - minimum({?Date Range}) )+1)
 
 
if you really want it to only be 1 the min and max are the same day then use:
 
if (Maximum({?Date Range}) - minimum({?Date Range}) )=0 then 1 else
(Maximum({?Date Range}) - minimum({?Date Range}) )


Edited by DBlank - 02 Jan 2015 at 8:52am
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