Download presentation
Presentation is loading. Please wait.
Published byMarkus Homewood Modified over 9 years ago
1
Atomic Context: The Key to Flexible Sub Summary Reporting Jeremiah Small San Mateo Staff Meeting, Nov 28, 2007
2
Atomic?! (more later) But first…
3
A Simple Example
4
No, seriously. It’s not as big a mess as it looks…
5
A Simple Example Requirements: 1. Report on various tables (at least 3) 2. Extract totals from 2 date ranges –Actual range as defined by user –Same range in the previous year 3. Show the % change between ranges and the % of the total for each range
6
Report: Rep Sales Totals
7
Report: Products by Class
8
Report: Products by Class then Rep
9
Report: Business Types by Territory
10
Report: Locations by Type then Rep
11
Report: Locations by Rep
12
Report: Products by Location
13
Report: New Locations by Territory
14
An Example Solution
15
So what about atomic context?! Oxford American Dictionary a-tom-ic: of or forming a single irreducible unit or component in a larger system. Disambiguation NOT used as in the same sense as an atomic operation in computer science which refers to a set of operations that can be combined so that they appear to the rest of the system to be a single operation with only two possible outcomes: success or failure.
16
So have I been misleading you?
17
What is the atomic context here?
18
These all run from Invoice Line context
19
But how can that be? 1. We don’t see Invoice Line items in reports 2. We need to extract 2 date ranges –Actual range as defined by user –Same range in the previous year 3. We need to compare values between ranges
20
1. No rule that you must display body
22
2. Conditional atomic values
29
So conditional atomic values let us do this…
30
3. Doing math on Summary values …but what about this?
31
3. Doing math on Summary values
33
What’s the catch? The break field in a GetSummary function… MUST BE LOCAL
34
3. Doing math on Summary values
35
The break field in a GetSummary function must be local?! …bummer :-( …but wait! Nobody said it can’t be a calc field! The trick? Bring all your break fields to the atomic context as calc fields.
36
3. Doing math on Summary values Bring all your break fields to the atomic context as calc fields. Bonus: You can add some logic to your break fields.
37
3. Doing math on Summary values Note: You can sort by the same summary field or a constant to get Grand Summary values.
38
3. Doing math on Summary values GetSummary () with localized break fields lets us do this $50,826.32 ÷ $1,546,456.07 = 3%
39
3. Doing math on Summary values GetSummary () with localized break fields lets us do this Let ( [ cur = GetSummary( _il_cur_AVG_price_sm ; _ct_RepName ) ; pre = GetSummary( _il_pre_AVG_price_sm ; _ct_RepName ) ]; Case ( cur ≤ 0 ; "" ; pre ≤ 0 ; "" ; cur > pre ; ( cur / pre - 1) ; pre > cur; ( pre / cur - 1 ) * -1 ; 0 )//endCase )//endLet
40
3. Doing math on Summary values GetSummary () with localized break fields lets us do this ($249,320.79 ÷ $50,826.32 -1 ) x -1 = -391%
41
…but it’s not just for FileMaker Sub-summarize records on a Web page First record
42
…but it’s not just for FileMaker Sub-summarize records on a Web page First group
43
PHP Sub Summary Do one query, not seven
44
PHP Sub Summary Do one query, not seven
45
PHP Sub Summary Do one query, not seven
46
PHP Sub Summary Do one query, not seven
47
PHP Sub Summary Remember the break field for Sub Summaries?
48
PHP Sub Summary Remember the break field for Sub Summaries?
49
PHP Sub Summary With records grouped by a break field, nested loops can print them to the screen just like FileMaker sub summaries
50
PHP Sub Summary Sub-summarize records on a Web page 1st group First record Second record Third record Second group And so on…
51
Concept Review Atomic Context –The table that represents an irreducible unit or component in the larger system. –If you find yourself considering complicated algorithms to extract report data from child records, question your context. Sub Summary –A field (column) representing a de-normalized (non-unique) attribute when treated as a group (break field) for all the records (rows) sharing that attribute. –In FileMaker this is achieved by sorting. –In PHP this is achieved by appending records into associative arrays named as the break field values.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.