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!

Calculating WIthin Group Summary

Status
Not open for further replies.

btodag

Technical User
Jan 13, 2014
10
US
I know this has to be easy but I'm just stumped. It's been a while since I used Crystal. I'm using standalone CR 11 against a dataset in a spreadsheet (temp as we develop for a stored procedure to supply data).

It's almost as if I need a pivot table/crosstab, but I need it to be drill-down possible.

Example of what I hope to get:
| AREA 1 | AREA 2 | AREA 3​
Group1 | %Flagged(G1, A1) | %Flagged(G1, A2) | %Flagged(G1, A3)
Group2 | %Flagged(G2, A1) | %Flagged(G2, A2) | %Flagged(G2, A3)
Group3 | %Flagged(G3, A1) | %Flagged(G3, A2) | %Flagged(G3, A3)


I have several groups and at each group I need to display a value that is Sum(FlaggedValue)/Count(AllRecordsWithinTheGroup) where Flagged value = 1 or 0 within the data and Count(AllRecordsWithinTheGroup) is the count of all records within the group. End result is a how many 1's as a percentage of all of that group's records but I also need this across a couple of Areas as shown above.

I can't even get a %Flagged to show up w/o it being the value for the whole recordset. I just get the same value everywhere. How do I make a forumla that recalculates depending on where it lands in the grouping?


I was thinking I could do something along the concept of (syntax ignored for conveyance):
If Area = Area1
then sum(flagged)/count(flagged)
Else 0

Thanks a ton!
 
When you want summaries for a group, the syntax is as follows:
SummaryType({Table.Field Being Summarized}, {Table.Field being Grouped By})

So, if you have a group based on a field called {Customer.Country} and you want the Count of the {Customer.CustomerName} for each country, it would look like this:
Count({Customer.CustomerName},{Customer.Country})

Bob Suruncle
 
Thanks Bob.

Is there anyway to make it movable/copy and paste the formula from one group to another and it automatically summarize for that group. I was hoping it worked the way a chart works, when I grab a chart and move it to another group, I get a chart relative to that group.

BG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top