Print Page | Close Window

need help with formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22943
Printed Date: 01 May 2024 at 7:19pm


Topic: need help with formula
Posted By: KimberlyS
Subject: need help with formula
Date Posted: 04 Aug 2021 at 2:49am
I have a Frequency from a document with formula of
If {DimDiscipline.DisciplineKey}=1 and
{DimDocumentType.DocumentType_ID}=1 then {DimTreatmentPlan.TxFrequencyLow}
ELSE
If {DimDiscipline.DisciplineKey}=2 and
{DimDocumentType.DocumentType_ID}=1 then {DimTreatmentPlan.TxFrequencyLow}
ELSE
If {DimDiscipline.DisciplineKey}=3 and
{DimDocumentType.DocumentType_ID}=1 then {DimTreatmentPlan.TxFrequencyLow}

This works correctly and pulls the frequency patient should be seen weekly. Then I have a formula for Week 1, Week 2 etc., that counts up to 7 days for each week beginning with a start date the 1st time patient was seen.

To Count the number of times seen in a week I created a @value formula of Whileprinting records; Numbervar sum; This also works.

Now I need each weeks total visits to be compared with the Frequency and I can't make it work. Example: if frequency is 5 and Week # >= 5 then 'Met' else 'Review'







Replies:
Posted By: lockwelle
Date Posted: 12 Aug 2021 at 10:44am
In the general overview, what I would do is use Shared Variables to set the values for each of the weekly counts, both the summary and the detail.
Now you can create formulas to compare the Shared Variables and report out the findings.

Hopefully this is helpful, as opposed to being obvious. Without knowing the details of your data or the various formulas already in use, it is hard to offer anything more solid.



Print Page | Close Window