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

Grouping based on formulas

Status
Not open for further replies.

kandikcj

IS-IT--Management
Dec 20, 2002
12
US
Hello everyone,
I was wondering if anyone out there has ever tried anything like this: I have accounts that get updated on different dates by different people. If the user does not follow the correct process the account gets flagged. What I would like is a count of the accounts, by user that last updated it, that are flagged. Since one account can be updated on many dates by different people I only want the most recent user to update it. So far I can get the report to give the the user that last updated it grouped by account number but what I would like is to get a count by user of all the accounts that they last updated. Any ideas?
Thanks,
Charlie
 
how about some formulas.
sam's count : if updated user = 'sam' then 1 else 0
joe's count : if updated user = 'joe' then 1 else 0
and then hide on the report and do a subtotal
or just do one formula
if update user <> " " then 1 else 0
and subtotal on user group level.
it's a thought.
jill messier
jillm@ccc24k.com

 
I thought of that but we have a dynamic list of users as well as potentialy hundreds of them. Would lead to a lot of hard coding
 
A little hard to picture, and without technical information, I would just be guessing.

Try posting technical info:

Crystal version
Database/connectivity used
Example data
Expected output

Describing requirements generally requires all of these.

If all you need is the count of those that last updated (again, per your limited description and no technical info), you can filter the rows for only that user and count everything.

This might be accomplished through conventional CR and SQL means, or by using a subreport.

-k
 
Group by account number, sort by date accessed descending.
Create formulas that track the most recent user of an account and accumulates the flagged events.

@Hdr_var_set //in account group header
global stringvar Most_recent_user := "";
global numbervar usercount:= 0;

@TallyUser //this in detail
global stringvar Most_recent_user;
global numbervar usercount;
if Most_recent_user <> "" then
(
if (Most_recent_user = <User name fld>) and
(<flagvalue> = True) then
usercount := usercount +1;
)
else
(
Most_recent_user := <User name fld>;
if <flagvalue> = True then
usercount := 1;
)
usercount

@SummaryUser //in account group trailer
global stringvar Most_recent_user;

@SummaryUserCount //in account group trailer
global numbervar usercount;

This counts the occurrance of the flagged event records only when it matches the most current user.

Scotto the Unwise
 
I am using Cyrstal 8.0 and the data that I am working with is basically set up like this; I have two tables accounts and encounters. Each account can be linked to may encounters. In the account table a flag is set if the user didn't update it correctly when an encounter was created. I only care about the user that made the most recent encounter. I would like to get a count for each user on the number of flagged accounts that they made the most recent encounter. I hope this isn't too confusing.
Charlie
 
Hiya Ro, always good to see the big guns out ;)

Most avoid Crystal's advanced features, and using the database to do the heavy lifting, you always have an interesting approach.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top