Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group summary/formula problem Post Reply Post New Topic
Author Message
Valmont
Newbie
Newbie
Avatar

Joined: 29 Jan 2007
Online Status: Offline
Posts: 39
Quote Valmont Replybullet Topic: Group summary/formula problem
    Posted: 29 Jan 2007 at 11:24am
Hi reader,

I'm very new to reporting (and using CRXI) yet I'm immediatly thrown in the middle of a crucial reporting-stage. We have NO experts. So I am alone... Cry

I'll show you the screeny of my current report and then I'll ask my questions.



My questions in order of importance (using crystal formula notation):
1) (**crucial**) : A customer (like Anthony) has 4 or more "test" in the "Action" field. I want to count the number of customers with 4 (or more) "call".
This needs to be a formula (or something) because I'll add that result in the report-footer.

2) (very high, not crucial) : Do I have to group it like this? I just need the formula-oject (or running total field!) to insert it in the report-footer. I may want to choose to setup the report in a different way.
Yet I do need the summary as mentioned in "1".

3) (moderate) : What if I want to summarize per user how many "call" he/she got?
Like:

NAME | CALLs | TESTs
Antho. | 1 | 4
Carla. | 3 | 2

Etc.
Like I mentioned, this is a crucial state of the reporting process. Once I get through this, I can handle the rest of the report most likely!


Edited by Valmont - 29 Jan 2007 at 11:33am
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 29 Jan 2007 at 12:28pm
1) Can you use a global variable and only increment it when the record has "call" in it?

2) You can hide whatever sections you don't want to view.

3) Use a cross-tab object. I have a chapter on it here on the website.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Valmont
Newbie
Newbie
Avatar

Joined: 29 Jan 2007
Online Status: Offline
Posts: 39
Quote Valmont Replybullet Posted: 29 Jan 2007 at 10:26pm
[quote] 1) Can you use a global variable and only increment it when the record has "call" in it?[/qoute]

Not skillwise. That's why I am here.
For the sake of consistancy with the report, I need a formula and then drag the formula to the reportfooter. Question is that I only can make very basic formula's.

Thank you for the reply by the way. This project important.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 30 Jan 2007 at 9:04am
Here you go...


Global NumberVar RTotal
If {table.action field} = "call" Then
   RTotal = RTotal + 1;


Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Valmont
Newbie
Newbie
Avatar

Joined: 29 Jan 2007
Online Status: Offline
Posts: 39
Quote Valmont Replybullet Posted: 30 Jan 2007 at 4:07pm
Thank you for your time but that is not what I meant. I could have been clearer.

Say a database has a record of 2 tables: Customer, Action.
Say we have 10 customers. Say we have 2 types of actions (AOne and ATwo).

Say customer "John" can have up to 50 actions. I am only interested if John has at least 4 times action "AOne". If he has then "CustomerActionOne_4Count" = 1.

Mary has at least 4 times action "AOne" as well!
So my variable becomes:
"CustomerActionOne_4Count" = 2.

That's because 2 customers have at least 4 x performed a certain action.
I don't care who they are, all I want to know how many users have that amount of that specific action.

Now the tricks is that this has to be a formula that does not depend on what is to be seen on the report:  I may not want to display any field of any table in the report. I just want to put formulas in the report. And this very formula is the most important one.

So the formula gets complex alright. Once again I totally used up my spare time. (1.05 am here). I'll try until I drop down from tireness but without help I'm lost.



Edited by Valmont - 30 Jan 2007 at 4:14pm
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 31 Jan 2007 at 12:14pm
Alright, I think I understand what you're trying to do.  You want a count of all customers who have 4 or more "Call" actions.
 
I think you can do this with a couple of formulas (I haven't tested this...)

Global NumberVar CustomerCallCount;
if (PreviousIsNull({table.customer id})) or ({table.customer id} <> previous({table.customerID} then 
  CustomerCallCount := 0;  //reset to 0 for each customer
If {table.action field} = 'Call' then 
  CustomerCallCount := CustomerCallCount + 1;
CustomerCallCount


if {@CustomerCallCount} >= 4 then 1 else 0
 
On your report, in the footer where you want to display this information, insert a summary to SUM {@Has4Calls} - Go to the Insert menu, select Summary, select your field and then "Sum".  If this is a total for the report, click on OK.  If it is a total for a group, select the group and then click on OK.
 
In order for this to work, your group or sort MUST have the customer id at a top level so that all records for a given customer are read consecutively before going on to the next customer.
 
-Dell
IP IP Logged
Valmont
Newbie
Newbie
Avatar

Joined: 29 Jan 2007
Online Status: Offline
Posts: 39
Quote Valmont Replybullet Posted: 01 Feb 2007 at 12:49pm
Jolly awesome! This looks promising!

Thank you. Deadline tomorrow (my time, it's evening here now).
It's funny to see how a certain skillset with Crystal Reports has direct influence on attracting more customers sometimes. This is one of these times. Tomorrow afternoon the potential customers comes to see if we can report decently!

That's the story behind this CR project :)

Once again, thank you all for your help.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.035 seconds.