+ All Categories
Home > Documents > Atomic Context: The Key to Flexible Sub Summary Reporting

Atomic Context: The Key to Flexible Sub Summary Reporting

Date post: 10-Jan-2016
Category:
Upload: mave
View: 24 times
Download: 1 times
Share this document with a friend
Description:
San Mateo Staff Meeting, Nov 28, 2007. Atomic Context: The Key to Flexible Sub Summary Reporting. Jeremiah Small. Atomic?!. (more later) But first…. A Simple Example. A Simple Example. No, seriously. It’s not as big a mess as it looks…. A Simple Example. Requirements: - PowerPoint PPT Presentation
52
Atomic Context: Atomic Context: The Key to Flexible Sub Summary The Key to Flexible Sub Summary Reporting Reporting Jeremiah Small San Mateo Staff Meeting, Nov 28, 2007
Transcript
Page 1: Atomic Context: The Key to Flexible Sub Summary Reporting

Atomic Context:Atomic Context:The Key to Flexible Sub Summary ReportingThe Key to Flexible Sub Summary Reporting

Jeremiah Small

San Mateo Staff Meeting, Nov 28, 2007

Page 2: Atomic Context: The Key to Flexible Sub Summary Reporting

Atomic?!

• (more later)• But first…

Page 3: Atomic Context: The Key to Flexible Sub Summary Reporting

A Simple Example

Page 4: Atomic Context: The Key to Flexible Sub Summary Reporting

A Simple Example

No, seriously.

It’s not as big a mess as it looks…

Page 5: Atomic Context: The Key to Flexible Sub Summary Reporting

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

Page 6: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: Rep Sales Totals

Page 7: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: Products by Class

Page 8: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: Products by Class then Rep

Page 9: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: Business Types by Territory

Page 10: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: Locations by Type then Rep

Page 11: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: Locations by Rep

Page 12: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: Products by Location

Page 13: Atomic Context: The Key to Flexible Sub Summary Reporting

Report: New Locations by Territory

Page 14: Atomic Context: The Key to Flexible Sub Summary Reporting

An Example Solution

Page 15: Atomic Context: The Key to Flexible Sub Summary Reporting

So what about atomic context?!

• Oxford American Dictionarya-tom-ic: of or forming a single irreducible unit or component in

a larger system.

• DisambiguationNOT 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.

Page 16: Atomic Context: The Key to Flexible Sub Summary Reporting

So have I been misleading you?

Page 17: Atomic Context: The Key to Flexible Sub Summary Reporting

What is the atomic context here?

Page 18: Atomic Context: The Key to Flexible Sub Summary Reporting

These all run from Invoice Line context

Page 19: Atomic Context: The Key to Flexible Sub Summary Reporting

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

Page 20: Atomic Context: The Key to Flexible Sub Summary Reporting

1. No rule that you must display body

Page 21: Atomic Context: The Key to Flexible Sub Summary Reporting

1. No rule that you must display body

Page 22: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

Page 23: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

Page 24: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

Page 25: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

Page 26: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

Page 27: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

Page 28: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

Page 29: Atomic Context: The Key to Flexible Sub Summary Reporting

2. Conditional atomic values

So conditional atomic values let us do this…

Page 30: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

…but what about this?

Page 31: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

Page 32: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

Page 33: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

What’s the catch?

The break field in a GetSummary function…

MUST BE LOCAL

Page 34: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

Page 35: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

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.

Page 36: Atomic Context: The Key to Flexible Sub Summary Reporting

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.

Page 37: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

Note: You can sort by the same summary field

or a constant to get Grand Summary values.

Page 38: Atomic Context: The Key to Flexible Sub Summary Reporting

3. Doing math on Summary values

GetSummary () with localized break fields lets us do this

$50,826.32 ÷ $1,546,456.07 = 3%

Page 39: Atomic Context: The Key to Flexible Sub Summary Reporting

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

Page 40: Atomic Context: The Key to Flexible Sub Summary Reporting

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%

Page 41: Atomic Context: The Key to Flexible Sub Summary Reporting

…but it’s not just for FileMakerSub-summarize records on a Web page

First record

Page 42: Atomic Context: The Key to Flexible Sub Summary Reporting

…but it’s not just for FileMakerSub-summarize records on a Web page

First group

Page 43: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummaryDo one query, not seven

Page 44: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummaryDo one query, not seven

Page 45: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummaryDo one query, not seven

Page 46: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummaryDo one query, not seven

Page 47: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummaryRemember the break field for Sub Summaries?

Page 48: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummaryRemember the break field for Sub Summaries?

Page 49: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummaryWith records grouped by a break field, nested loops can print

them to the screen just like FileMaker sub summaries

Page 50: Atomic Context: The Key to Flexible Sub Summary Reporting

PHP Sub SummarySub-summarize records on a Web page

1st groupFirst recordSecond recordThird recordSecond groupAnd so on…

Page 51: Atomic Context: The Key to Flexible Sub Summary Reporting

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.

Page 52: Atomic Context: The Key to Flexible Sub Summary Reporting

</presentation>


Recommended