Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables for Dummies 2

Status
Not open for further replies.

cmpgeek

Technical User
Feb 11, 2003
282
US
i know they have a Crystal for Dummies book out there, and i am closer and closer to buying one...

i have a formula that is based on case service that determines how many minutes are needed for turnover time.

the report breaks down by the OR room -> then by day of the week. it already totals for all the Mondays / Tuesdays etc, what i need to do is get a total for rooms seperately and then a grand total at the end.

Crystal will not let me get a running total or anything (as we were discussing in my last post)...

can someone please explain to me how to do the variables to accomplish what i need (in the simplest form possible)... i know how dumb i must sound, but trust me - i hate feeing this dumb more than you can imagine... for some reason i feel like i have hit a brick wall where variables are concerned... i start to get a feel for them, and then i dont need them for a while and i lose whatever grasp i DID have before... [hammer] <--- my first hammer of the week...

thanks in advance for any advice or suggestions yall may have...


[americanflag] ShannonLea [americanflag]
 
Posting example data and expected output will generally result in better suggestions.

There's a standard 3 formula method for performing manuall aggregate functions, which works something like:

Report (or Group) Header:
(you suppress this)
whileprintingrecords;
numbervar MySum := 0;

Detail (or Group Footer if you're summing some subtotals of a group) Header:
(you suppress this, or show it to have a running total)
whileprintingrecords;
numbervar MySum := MySum + {table.field};

In the above you can place whatever value you want for {table.field}, inclusive of any sums/counts/etc.

Report (or Group) Header:
(you show this for totals)
whileprintingrecords;
numbervar MySum;
MySum

Hope this helps to clarify.

-k
 
Sorry, in the rpevious post, this:

Report (or Group) Header:

should be

Report (or Group) Footer:

-k
 
thanks synapsevampire... i didnt put examples here because - even though i am looking for something specific right now - i didnt know if there was just a basic concept of a variable that i could use as a template or what...

all Crystal gives you for a number variable is

numberVar := ;

wich does not help me much at all and i feel like i am reading in circles even going back through my notes...
Ido posted a variable formula in the earlier post i mentioned above, but since i am so clueless where variables are concered, i can not follow the logic... not that i need to understand it to use it, but i WANT to understand it... (if for no other reason that so i wont be cluttering up the boards with the same question multiple times...)

thanks again... both for the advise and the URL - i have looked around there a bit but have not been able to purchase anything as of yet...

[americanflag] ShannonLea [americanflag]
 
another dumb question... the things i am suppressing - are they just in regular old text fields?

... < sigh > i feel like i am working in DOS again... [sadeyes]

[americanflag] ShannonLea [americanflag]
 
You're doing fine, variables are somewhat awkward to work with, and poorly documented.

They are built in formulas, not text fields. Insert->Field Object->Right Click Formula Fields->New

They can then be referenced by other forulas providing they are at least GLOBAL variables (which is the default.

You can explicitly state they are:

LOCAL: only used by this formula
GLOBAL: (not required to explicitly state), which are available to other formulas throughout the report
SHARED: Available throughout the report and to subreports.

Hope this helps.

-k
 
synapsevampire

THANK YOU! THANK YOU! THANK YOU!

i actually changed all my grand total fields over to variables just so i could have the practice...

hopefully i will hold on to it this time...

thanks again !



[americanflag] ShannonLea [americanflag]
 
Think of a variable as a place to store stuff. You put things into a variable, get things out, and change them. All programming languages have variables.

The key thing in CR is that a variable must be declared in each formula that uses a variable - so spell their names the same if they are the same variable.

You declare a variable with Stringvar, numbervar, datevar, etc. The type indicates what type of data is stored in the variable.

You assign a variable with :=
A lot Vb programmers make the mistake of
variable= value;
All that does is test if they are equal. It should be
variable := value;

Evaluation time is also important if you are using variables. I've found adding
WhilePrintingRecords;
to start of any formula with variables seems to fix a lot of problems.

Editor and Publisher of Crystal Clear
 
thank you chelseatech - that helps as well!

[americanflag] ShannonLea [americanflag]
 
The Turnover time analysis problem you've been experiencing is perhaps due to the NEXT or the PREVIOUS functions in your formulae. Also, you may wish to use seperate variable formulae for each Surgeon specialty, Level of procedure, etc. Additionally, a filter for delays between cases may be a consideration, say, only if turnover is <60 minutes.
 
actually the reason the turnover time is a formula is because we base our average turnover times on the service... our open heart cases as well as any major vascular cases are allotted twice as much TO time as the rest of the OR.

we do have a seperate TO report that we run daily. and we do run across larger TO times if the next case is not scheduled directly to follow or such... however, that report also lists the surgeon which helps us to figure out the delay issue(s)... also, we keep the printout of this report with the printed copy of the schedule so it is easy to check on those things....

but i do thank you for your suggestion [smile]

[americanflag] ShannonLea [americanflag]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top