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

Problem using SUM on group summaries 2

Status
Not open for further replies.

ryan7

IS-IT--Management
Sep 1, 2004
5
GB
I have a very large amount of data, each line represents an Action by a user. I need to summarise, for each individual user the number of times they have used a particular application. The tricky part is that i can't take the total number of application usages, i need to see the number of times the application has been launched on unique days... i.e. how many unique days has the user launched the application at least once.

IF {action.result_type} = "Success" AND {action.message} = "User launched App1" THEN 1 ELSE 0

I was using the above forumula, and then grouping the data by User (group 1) and then by Date (group 2). In the Date group I was doing a MAXIMUM summary, but the problem is that i couldn't then do a SUM of all the MAXIMUM summaries and put it into the User group heading...

Can anyone give me any suggestions on a way around this?

Thanks in advance :)
 
Use a variable. On your User header, create a formula such as :

G1ClearVar (formula name)

Whileprintingrecords;
Global Numbervar UserCount;
UserCount := 0;

On your Date group footer, reference the variable such as:

G2Processing (formula name)

Whileprintingrecords;
Global Numbervar UserCount;
Usercount = Usercount + Max({whatever field you were using}, {Whatever your date group field is});

Then on your user group footer, show the current variable:

G1UserCount (formula name)

Whileprintingrecords;
Global Numbervar UserCount;
UserCount;

 
thanks for the great reply dk87. much appreciated :)

the concept seems to work, but i think i may have made a mistake in the implementation of some part of the forumla

The G2Processing forumla seems to return TRUE / FALSE result (rather than a numerical result as i would have expected). As a result the G1UserCount Formula is always returned as 0

Any ideas as to how i've managed this ... thanks again in advance :)

G1ClearVar
Whileprintingrecords;
Global Numbervar UserCount;
UserCount := 0;

G2Processing
Whileprintingrecords;
Global Numbervar UserCount;
Usercount = Usercount + MAXIMUM ({@APP1}, {action.time}, "daily");

G1UserCount
Whileprintingrecords;
Global Numbervar UserCount;
UserCount;

@APP1
IF {action.result_type} = "Success" AND {action.message} = "User launched App1" THEN 1 ELSE 0
 
use a :=, not an =, whenever you are assigning a value to a variable.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Thank you very much once again ... worked a treat :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top