dbTalk Databases Forums  

Summing a Summary Some how...

comp.databases.filemaker comp.databases.filemaker


Discuss Summing a Summary Some how... in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
VoicesInMyHead
 
Posts: n/a

Default Summing a Summary Some how... - 04-26-2007 , 11:06 AM






I have a summary report that works just fine. However, the powers
that be would like to add an additional total - this is confusing me.

Header (select date range)
SubSummary Part ::Store
SubSummary Part ::MonthName
SubSummary Part ::Category
SubSummary Part :rug
Footer (empty)

This groups drugs by name in their category, by Month per Store,
showing total prescriptions written for the drug, total acquisition
cost, and total sales dollars.

Store 10
January
Dermatology
Clobetasol 0.05% Rx# 2 Acq$35.00 Sales$200.00
Lidocaine 5% Rx# 10 Acq$45.00 Sales$80.00
Pain Management
Celebrex 200mg Rx# 5 Acq$425.00 Sales$550.00
Store 11
January
Dermatology
Clobetasol 0.05% Rx# 4 Acq$70.00 Sales$400.00
Lidocaine 5% Rx# 20 Acq$90.00 Sales$160.00
Pain Management
Celebrex 200mg Rx# 10 Acq$850.00 Sales$1100.00
etc....

Now, I have to total sales for each Category (only 12 categories) for
the reported date range.

Dermatology = $840.00
Pain Management = $1650.00
Etc...

I don't think a Trailing Grand Summary will work here - what kind of
calc am I looking for? I played with a GetSummary, but I must be
using it wrong....

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Reality is the leading cause of stress...
....amongst those in touch with it.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
WinXP Pro 64Bit / FMP Adv 8.5v2
VoicesInMyHead
a.k.a. The Voices
No, we're not... Yes, we are...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Reply With Quote
  #2  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Summing a Summary Some how... - 04-27-2007 , 09:24 PM






In article <1177603602.132226.12110 (AT) o40g2000prh (DOT) googlegroups.com>,
VoicesInMyHead <voices.imh (AT) gmail (DOT) com> wrote:

Quote:
I have a summary report that works just fine. However, the powers
that be would like to add an additional total - this is confusing me.

Header (select date range)
SubSummary Part ::Store
SubSummary Part ::MonthName
SubSummary Part ::Category
SubSummary Part :rug
Footer (empty)

This groups drugs by name in their category, by Month per Store,
showing total prescriptions written for the drug, total acquisition
cost, and total sales dollars.

Store 10
January
Dermatology
Clobetasol 0.05% Rx# 2 Acq$35.00 Sales$200.00
Lidocaine 5% Rx# 10 Acq$45.00 Sales$80.00
Pain Management
Celebrex 200mg Rx# 5 Acq$425.00 Sales$550.00
Store 11
January
Dermatology
Clobetasol 0.05% Rx# 4 Acq$70.00 Sales$400.00
Lidocaine 5% Rx# 20 Acq$90.00 Sales$160.00
Pain Management
Celebrex 200mg Rx# 10 Acq$850.00 Sales$1100.00
etc....

Now, I have to total sales for each Category (only 12 categories) for
the reported date range.

Dermatology = $840.00
Pain Management = $1650.00
Etc...

I don't think a Trailing Grand Summary will work here - what kind of
calc am I looking for? I played with a GetSummary, but I must be
using it wrong....

Luckily you don't need the GetSummary function at all.

Since you're wanting a total for ALL the records in the Found Set, the
easiest way to achieve this is using normal Summary fields in
conjunction with some extra Calculation field.

Firstly you need to create some Calculation fields that split the Sales
Price for each record into the appropriate category.
eg.
DermatologySales Calculation, Number Result
= If (Category = "Dermatology", SalesPrice, 0)

PainManagementSales Calculation, Number Result
= If (Category = "PainManagement", SalesPrice, 0)

etc. One for each of the 12 Categories.

This means each record now has a field containing the SalesPrice for
just that Category type, with all the other Category types being zero.


Now that you've got these you can simply create extra Summary fields to
total the values.
eg.
sum_DermatologySales Summary
Total of DermatologySales

sum_PainManagementSales Summary
Total of DermatologySales

etc. Again, one for each of the 12 Categories.


Lastly on the report Layout, add a Trailing Grand Summary part and put
the 12 Summary fields onto it alongisde typed in text for the
appropriate Category.
eg.
Dermatology = [sum_DermatologySales]
Pain Management = [sum_PainManagementSales]
etc.

where the [] denotes the fields.

Find the required records, sort them as you already are for the rest of
the report and then print or Preview the results.


As an aside, an Acquistion price of $35 and a Sale price of $200 for
Clobetasol seems like a very greedy profit margin. I hope those are
just faked example numbers! (



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #3  
Old   
VoicesInMyHead
 
Posts: n/a

Default Re: Summing a Summary Some how... - 04-28-2007 , 09:13 AM




Quote:
As an aside, an Acquistion price of $35 and a Sale price of $200 for
Clobetasol seems like a very greedy profit margin. I hope those are
just faked example numbers! (

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)- Hide quoted text -

- Show quoted text -
Ok, I had created the calc fields... but forgot to create the summary
fields for them... Doh! Man, I need a vacation.

And yes, those are fake numbers... LOL You're right, should have
made it about 40% margin - but then I would have had to think about it
for another 0.25 seconds.....

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Reality is the leading cause of stress...
....amongst those in touch with it.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
WinXP Pro 64Bit / FMP Adv 8.5v2
VoicesInMyHead
a.k.a. The Voices
No, we're not... Yes, we are...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Reply With Quote
  #4  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Summing a Summary Some how... - 04-28-2007 , 04:07 PM



In article <1177769600.846820.160680 (AT) y5g2000hsa (DOT) googlegroups.com>,
VoicesInMyHead <voices.imh (AT) gmail (DOT) com> wrote:

Quote:
As an aside, an Acquistion price of $35 and a Sale price of $200 for
Clobetasol seems like a very greedy profit margin. I hope those are
just faked example numbers! (

Ok, I had created the calc fields... but forgot to create the summary
fields for them... Doh! Man, I need a vacation.

And yes, those are fake numbers... LOL You're right, should have
made it about 40% margin - but then I would have had to think about it
for another 0.25 seconds.....
40% is still extremely high. Even Apple only makes around 30% at best
(depending on which product it is).


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.