Previous()^s Memory??

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
rickmds
Posts: 38
Joined: Tue Oct 10, 2017 12:44 pm

Previous()^s Memory??

Post by rickmds » Wed Feb 20, 2002 7:17 am

Hello__I am using Windows 2000 with 512 MB of memory & R&R 9 with the latest patch. My current project requires me to work with a DBF table with approximately 2 Million records. One task is to identify unique consumers; I accomplish this by sorting (or using the index tag consum_id) on the field consum_id and then summing at the appropriate group level with the formula iif(previous(consum_id)= consum_id,0,1). This works fine except... if the report is run twice the above field does not sum correctly and it is significantly greater & erronious. In order to correct this problem I need to close the report, re-open & re-run to obtain the correct unique consummer totals. It appears that this unique total is affected by or is related to the variable memory retained by the computer.__Question: Is this a known problem and/or is there another way to determine unique consumers?__Thank you__Rick

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Previous()^s Memory??

Post by kfleming » Wed Feb 20, 2002 7:30 am

If you create a total field that is a count of consum_id with an accumulation of once per consum_id and a reset of grand you will get a count of the number of unique consumers. If you also make it pre-processed, then you can use it anywhere in the report.____I am not sure why you might be seeing the erroneous results using your current previous() derived method.____Kathleen__R&R Support

Gene_Clark
Posts: 10
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Previous()^s Memory??

Post by Gene_Clark » Fri Mar 08, 2002 4:29 pm

Hey, I wonder if I have a similar problem (that^s driving me crazy). I^m using R&R Xbase 8.1.027 in Win2000, 512M RAM on a set of FoxPro data bases. I have some conditional totals that are not computing correctly, and in fact sometimes print out as "*****". I can^t even use computations based on the totals with "*****"; it is as if there is something randomly left in RAM (like my the old days in FORTRAN where I would use a variable without initializing it). Some totals identically calculated, except with a slightly different condition, seem to work fine.____Even stranger yet is that, if I create a new variable, even one called "junk1" which I define to be the number 1, the problem goes away for some of the totals. It^s like the "memory hole" is shifted by adding another variable into the stack.____I^ll tried pre-processing, and thought that solved the problem, but it just crept up again later. Plus, after I preview the report once, when I preview again, the "****"s show up in a few other places.____I have no solution for this, but would appreciate hearing about anything you have learned.

cooperds_(Guest)
Posts: 6
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Previous()^s Memory??

Post by cooperds_(Guest) » Mon Apr 15, 2002 5:29 pm

I^ve run into a somewhat similar problem using either R&R 7 (Arpeggio 2.0) on a Windows 2000 machine with 256M RAM, running against an Oracle8i/DB2 backend. ____I^m trying to write a report that shows employees who^ve worked more than 6 days in a row, consolidating all consecutive days into a single line in the report showing how many days they worked in a row. I have a calculated field called ^nextday^ : __ DAYSBTWN(cal_dt, prev(cal_dt))=1____(cal_dt is a date-time field, but the time is set to 12:00:00 on every record)____I use this to determine whether entries are for consecutive days.__When I use it in a calculation it consistantly works correctly (i.e. allows me to accumulate days when the dates are consecutive and resets when they are not). But if I print this field by itself, it incorrectly returns .F. about 90% of the time... only sporadically returning the correct .T. value. I created a calculated field with just "prev(cal_dt)" , that returns the current record^s value (not the previous) about 90% of the time... only sporadically returning the previous records value..____Anybody have a clue about what is going on here?____

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: Previous()^s Memory??

Post by kfleming » Mon Apr 15, 2002 8:28 pm

I would probably need your actual data to determine why it is going wrong. I just did a quick test on a datetime field (in a report with a single table and R&R Version 9) and for me the logical calc worked correctly for each record..____Kathleen__R&R Support

Post Reply