Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique counts - subtotals
Message
From
20/12/2000 12:44:16
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00455221
Message ID:
00455487
Views:
50
Diana:

First, add an AgeFlag field (for example: infant = 0, child = 1, adult = 2, senior = 3) because an individual can have a birthday between visists.

Now, assuming the data is ordered by Primary Insurance + AgeFlag + ID + Visit Date, then you can use groups on your report (Primary Insurance, AgeFlag, ID) and use a report variable to count the number of distinct visitors.

For example, add these report variable in order:

mCount
*Original value = 0
*Store = IIF(PI <> mPI or AF <> mAF or AF, mCount + 1, mCount)

mPI
*Original value = "##"
*Store = PI

mAF
*Original value = "##"
*Store = AF

mID
*Original value = "##"
*Store = ID

where PI is primary insurance, AF is age flag. The order of the variables in report variables is very important.

Having said all this, I agree with Nadya that it is best practice to do these calculations outside of the report form. The trick above works well but it's hard to maintain in a team environment.

Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform