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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

my variables are counting wrong...

Status
Not open for further replies.

cmpgeek

Technical User
Feb 11, 2003
282
US
i have pasted below 4 columns of numbers... the first column is the amount of time between when a case is SCHEDULED to start and when it actually starts... the second column is the result of a formula that gives each entry a 1 or a 0 depending on the total of the column before it. the next column is the variable. the last column is what i should be seeing in the variable column if i am understanding them correctly...

the way i am thinking it through, when the variable finds the first entry "0" it adds that to itself and remains at 0... then after that - because the point formula registers a "1" - the variable should increase by 1 for each entry...
for some reason it is adding right on some entries and not others... can anyone think of what i may be doing wrong to be getting this result?

# of mins point result variable result expected variable
2 0 0 0
52 1 1 1
12 1 4 2
47 1 5 3
32 1 6 4
27 1 7 5
18 1 8 6

thanks...


[americanflag] ShannonLea [americanflag]
 
you haven't described the report structure or formulas involved so it is hard to tell....

It probably has to do with the placement of the formula calculating the Variable...

Is it placed in the detail section?? If so perhaps the result is being incremented by multiple records...rather than just once...placing this in the appropriate footer section may make it calculate properly.



Jim Broadbent
 
i apologize for not giving yall enough information, i guess i am always afraid i will give so much people wont want to read through it all...

the information is grouped by day...

the point forumla simply states if {elapsedtime}>5 then 1 else 0

my variables are set up like this:

GROUP HEADER
whileprintingrecords;
numbervar pointtotal:= 0;

DETAILS SECTION
whileprintingrecords;
numbervar pointtotal := pointtotal + {@points};

GROUP FOOTER
whileprintingrecords;
numbervar pointtotal;
pointtotal


both the point formula and the variable are in the detail section, and i had wondered if that was part of the problem; but when i moved the detail section variable to the group footer all i get is "1"...

ive been trying everything i can think of before bothering anyone here; but i am stumped on this one...
 
synapse,
the data, results, and expected results are all posted in the original message...

and i just posted another message with the formulas ive been using

[americanflag] ShannonLea [americanflag]
 
We need to see this formula

{@points}

Also is there only one group...and is there more than one detail line expected/group value....this is what I think is happening...

Finally this report...is it displayed in the Group footer? I think so and lends more credence to my thoughts on multiple details



Jim Broadbent
 
OK, I guess I understand it now, somewhat, you've posted the number of minutes and the result of some formulas.

As Jim states, the @points is suspect, as your aggregate formulas look fine.

It may be a timing issue, perhaps if you add something like the following to the details section:

DETAILS SECTION
whileprintingrecords;
evaluateafter({@points});
numbervar pointtotal := pointtotal + {@points};

If not, post what's in @points.

-k
 
The {@points} formula was posted in her first response as
{elapsedtime}>5 then 1 else 0


Since the two formulas are on the same band, try adding the EvaluateAfter funtion to your details band field.

EvaluateAfter({@points});
whileprintingrecords;
numbervar pointtotal := pointtotal + {@points};

Mike
 
I just saw that I am guilty of "didn't read all of the post" syndrome. I missed SV's suggesting the use of EvaluateAfter.

Mike
 
Yeah but you get points for being more succinct, Mike ;)

I wasn't positive if that was the formula or not, I think that you're probably right.

-k
 
ok... i have officially learned that one should not start with someone else's base report... i was going back through every field making sure nothing was being suppressed if duplicated... when i had checked each field i went to the section formatting option... there i found a conditional suppression formula in the details... the numbers it was getting were correct, but some of the data was being suppressed and i did not realize it...

<shaking my head in disgust> i am so sorry yall... it just had not dawned on me to look there as i knew i had not entered anything in there...

<wishin we had a &quot;donkey&quot; icon to use cause i sure feel like one now...>

[americanflag] ShannonLea [americanflag]
 
So I was correct....there were more than one detail line /group



Jim Broadbent
 
there had always been more than one detail line per group... all the lines in the original post were from 1 date/group... the problem was that within each grouping there were lines being suppressed...

i really do appreciate all the help i get from yall on here... im sure i have left a couple of you smacking your heads off your desk on one occassion or another, and i apologize for that... i just want to make sure yall know that your help is invaluable to me...there are times i just cant think anymore - and usually the answer is right there in front of me... sometimes i even find it while i am typing in the post...

thanks again...

[americanflag] ShannonLea [americanflag]

&quot;I keep hitting 'escape' but I'm still here...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top