Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Division Sub-summary issue

Featured Replies

Hi,

I have a system which sores books sold and their publisher. A report I need to display will take any subset of "sales" and give the following sub-summaries:

a) The total number of sales in the found set for each publisher in the found set

:) The percentage of the "number of sales for each publisher" compared with the total number of sales in the found set (for all publishers).

Fairly simple, if you have 1000 records, and two publishers in the found set, with PubA having 200 records and PubB having 800 records then PubA will have 20% and PubB will have 80%.

Sub-summary (a) from the above is displaying correctly. However Sub-summary (:) is displaying an incorrect percentage. The number is close but incorrect, and I'm not sure if it's a number storage precision problem or if I'm trying to do something you shouldn't be able to.

Please see that attached, the important numbers are "Total Adoptions", gn_RecordCount and Market_Share_Fraction. The market share fraction for MLH (top) should be 94.18% according to my calculator...

I've attached a pic "Definition" showing how the summary fields are defined:

The "Total Adoptions" is referencing sn_Adoption_Count, this is correct

The MarketShare_Fraction is referencing "sn_MarketShare_Fraction", this is displaying wrongly right now.

I've spent a few hours hacking around trying to figure this one out. If anyone could help me that would be great.

-Nick

Picture_2.jpg

Definition.png

I don't understand this too well (a sample file would be more helpful than the screenshots). I am guessing the 4 numbers are sub-summaries themselves, and that they count the PK of the actual records.

If so, it's pure coincidence that you are getting a result that is close to the expected. Your summary field, sn_MarketShare_Fraction, is defined as Fraction of Total - which means it ADDS the ID's, not COUNTS them. The only time this would work correctly would be when all records have the same PK value.

Try a calculation field =

GetSummary ( sn_Adoption_Count ; Publisher? ) / sn_Adoption_Count

  • Author

Hi and thanks for the reply. I'll try to get a sample file together but I didn't make the original report so it may take a while.

The grey part on the report with the market share number is a sub-summary sorted by title::publisher, where title is a parent of adoption. So yes, the fields are all sub summary fields.

I had tried the GetSummary script step as you suggested before actually and didn't get anywhere.

Please see the attached pics where I try to define two cal fields to get the summary numbers, and also to display them. As you can see they can't reference data. Is this because the part is already a sub-summary part?

Picture_2.png

Picture_3.png

  • Author

Actually, I just hacked a workaround, if you have a field in the adoption table that = 1 for every record then you get the correct data for the "Fraction of total" sub-summary step. Would still like to know why the other GetSummary fields don't work but at least I have a way forward.

GetSummary() only works when breakField is a local field (in the same table). You can use the matchfield to the title table as the breakField - but the sub-summary and the sort order need to be changed accordingly. If this creates a problem with the sorting order, you can define an unstored calc = title::t_Title_Publisher and use that instead.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.