Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Previous Value Post Reply Post New Topic
Author Message
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Topic: Previous Value
    Posted: 30 Sep 2011 at 6:12am
I'm trying to calculate previous value when I attempt to get the value, I get the message; "This field has no previous or next value". That is correct, but I'm trying to determine the value.
 
Any suggestions would be greatly appreciated.
 
Thanks,
CoachGBT
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Sep 2011 at 7:03am
What exactly are you checking?
IP IP Logged
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Posted: 30 Sep 2011 at 8:13am
I'm trying to get a monthly calculation of number of action items with a status of OPEN and a status of RELEASED. So my calculations would be something similar to
 
Previous Month Total + OPEN Status - RELEASE Status = BACKLOG or End of Month Total.
 
Now Previous Month Total doesn't have a starting value, but I intend to use End of Year total as my Previous Month Total (Dec 2011) value to carry over for the start of 2011 (Jan).
IP IP Logged
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Posted: 04 Oct 2011 at 4:25am

This is what I accomplished so far;

IF GROUPNAME ({@NEW_DATE}, "MONTHLY") = 'JAN' THEN
145 + (SUM ({@CREATED CT}, {@NEW_DATE}, "MONTHLY") - SUM ({@RELEASED CT}, {@NEW_DATE}, "MONTHLY"))
 
FYI:
Total Prior to JAN-11  =  145
         Jan Created CT =  137
       Jan Released CT =  115 
    Jan Backlog Count =  167
 
From here I would like to pass the Backlog Count to the following months (Feb - Oct), but I get a 0 for my Backlog Count for (Feb - Oct). This is what I've tried to get on-going Backlog Count:
 
IF {@MONTH} = 'JAN' THEN 0 ELSE
 {@BACKLOG} + Sum ({@CREATED CT}, {@NEW_DATE}, "monthly") - Sum ({@RELEASED CT}, {@NEW_DATE}, "monthly")
 
Thanks,
CoachGBT
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2011 at 5:09am
Sorry Coach, lost track of your post...
Previous() is a function that is referencing exacly the row above a row, it is not in reference to anything else. So your "Previous Month Total" was asking for the value from a field called "month Total" from the previous row of data. That is a non-existent field hence the error you got.
I think I see what you are trying to do here but not being familiar with your data it is very difficult to tease out.
I am assuming you have several if then formulas here that make a 1 or 0 based on your conditions.
You can used shared variable formulas to do conditional adding or subtracting (passing a value to the next row/group) but i think I would do this a little differently (as I prefer Running Totals anyway). This is not answering your question directly because I think the path you are on is going to get too convoluted and I would restart down a different 'cleaner' path...
 
Create one RT for the Year start
name=yearstartamount
field to summarize=whateer field is your 145 value
type = sum
evaluate=use a formula
onfirstrecord
reset=never
//this gives you one constant value for the entire report
another RT
name=monthlycreated_reset
field to summarize={@CREATED CT}
type=sum
evaluate=for each record
reset=group ({@NEW_DATE})
 
another RT
name=monthlycreated_NO_reset
field to summarize={@CREATED CT}
type=sum
evaluate=for each record
reset=never
 
another RT
name=monthlyReleased_reset
field to summarize={@RELEASED CT}
type=sum
evaluate=for each record
reset=group ({@NEW_DATE})
 
another RT
name=monthlyReleased__NO_reset
field to summarize={@RELEASED CT}
type=sum
evaluate=for each record
reset=never
 
Total Prior to JAN-11  =  145   (show #yearstartamount on first
         Jan Created CT =  137   (#monthlycreated_reset)
       Jan Released CT =  115    (#monthlyReleased_reset)
    Jan Backlog Count =  167   (formula field as:
#yearstartamount on first + #monthlycreated_NO_reset - #monthlyReleased_NO_reset


Edited by DBlank - 04 Oct 2011 at 5:11am
IP IP Logged
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Posted: 04 Oct 2011 at 6:51am
I get what direction you have me going, but I'm stumped with the on-going Backlog Count (Feb - Oct)
 
From here I would like to pass the Backlog Count to the following months (Feb - Oct), but I get a 0 for my Backlog Count for (Feb - Oct). This is what I've tried to get on-going Backlog Count:
 
IF {@MONTH} = 'JAN' THEN 1 ELSE
 {@BACKLOG} + #monthlycreated_NO_reset - #monthlyReleased_NO_reset
 
I'm still getting 0 for (Feb - Oct) Backlog Count.  I tried passing the value from this formula :
#yearstartamount on first + #monthlycreated_NO_reset - #monthlyReleased_NO_reset
 
to a new formula name BACKLOG.
 
Thanks,
CoachGBT
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2011 at 7:07am

A few trouble shooting suggestions.

1 place each individual RT on the detail lines and scrutinize each one per row and group footer to make sure it is doing what you want/expect. My initial guess is that for each of the "NO_reset" RTs you accidently have then reseting on each group.
Let me know what you find when you look ata each RT.
IP IP Logged
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Posted: 04 Oct 2011 at 7:57am
Got It! Oversight on my part.
 
Greatly Appreciated!
IP IP Logged
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Posted: 06 Oct 2011 at 2:51am
Thanks for all your help.
 
I have a question about Cross-Tab:
I have a Formula (the formula has RT Fields) and I want to add the Formula to Cross-Tab as a Summarized Field. When I open the Cross-Tab Expert, the Formula I want to add doesn't appear in the list of Report Fields to choose from.
 
So far the Cross-Tab has eleven columns,  months (Jan - Oct) and Total, and two rows this is all fine and well. My two rows are:
Created CT
Released CT
I want to add a third row:
Backlog CT (And for Backlog CT I want to use the Formula that has RT Fields). This is the formula:
{#yearstartamount on first} + {#monthlycreated_NO_reset} - {#monthlyReleased_NO_reset}
 
Thanks Again,
CoachGBT


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Oct 2011 at 4:39am
I think that an RT itself can sometimes be added to a crosstab however they act more like whileprintingrecord formulas which get created in a later data pass. I think sometimes the design/grouping of the crosstab can make a RT ineffective if it does not match the group structure of the report (that defines how the RTs are created).
My inital guess is the {#yearstartamount on first} is making it not available in the CT.
You might have to resort to mimicking a CT in the report footer if it is critial for your report.
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.031 seconds.