Skip to Content mrc logo mrc logo
  • What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • What does m-Power build?
    Solutions by Industry
    Overview Database Front-Ends AI Reporting CRM Systems Business Intelligence Dashboards Inventory Management Mobile Apps ERP Enhancements Modernization
    Spreadsheets to the Web MS Access to the Web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs & Web Services Db2 Web Query Alternative
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Development Services Training Mentoring
  • Overview Partners Press Releases Careers Events Contact Blog
  • Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • Deprecated Documentation
  • Group by within Reports
Back to Manual

Group by within Reports

 

This document explains how to setup your report applications to take advantage of the Group By functionality and also contains information pertaining to additional configuration options.

What is the Group By Feature & why do I want it?

The ability to group data by a specific value allows you to effectively create summarized data without the need for detail records. You select a field by which to subtotal and the SQL statement will sum all numeric fields for that subtotal and output them on the subtotal line. No detail lines will be printed, nor will any time be taken to analyze the detail line by m-Power.

For instance, let's say my business, www.crazybikes.com, ships products to all 50 states. When I review my sales history for the previous year, I may have upwards of 100K records in my table. Naturally, I am not interested in each particular detail line, but I do want to know high end information. For instance, what is my Profit per State, or perhaps Profit per Item? With the update, all I need to do is set my Report to be a "Summary Report" (This option is available in the Application Defaults screen), and subtotal by State and by Item. When I run my report, it will group by both State and Item and output only subtotal information. Since I am only outputting Subtotal information, the usual 10K record governor will be ignored.

How is this different from my current reports?

Currently, m-Power reports must compute detail records in order to total them at Subtotal/Grand-total time. This process takes both time and database resources to compute. However, with the GROUP BY feature, the SQL statement is modified to let the database GROUP BY key values. This eliminates the need for m-Power to compute each detail line. Prior to this update, to do something like this in the current m-Power, you would need to create a summary file first, then a report over the summary. This feature allows you to skip the process of creating a summary and, instead, go directly to building your report.

Ok, you've sold me on why I need it, but how do I implement it?

This feature comes standard on all Reports. However, if the Detail level of Data is checked on the prompt page, the GROUP BY functionality will not occur. Simply put, if you want to see detail information, there is no advantage to running a GROUP BY statement. This detail option is checked by default, however you can remove it per application in the Application Defaults screen. Please see below:

Note: Alternatively, you can remove the Checkbox via m-Painter, or your end-user could simply uncheck prior to running their application.

Note: The GROUP BY functionality is disabled in a Report by default if any of the following conditions are true:

· The use of Application Calculations exist

· The use of External Objects exist at a Detail level (Using External Object Locations of *JCALCOBJ or *JREADRCRD)

The reason for this is that it is assumed if either of these is true, your goal is to determine Detail information, not Subtotaled Information.

Note: The majority of user calculations will not cause any problems. Only when you have selected a Calc Type of "Application" will Group By be disabled by default (see image below).

What configuration options do I have?

All configuration options can be found in Application Properties. Once Application Properties is open, navigate to the "Column SQL Type" tab.

Notice that all Alpha fields have a value set to "Max" while all Numeric Fields have a value of "Sum". This is the default setting; however Alpha values have the option of "Max" or "Min". Numeric fields have the option of "Max", "Min", "Sum", or "Avg".

· Min — SQL examines all values for this field and returns only the smallest one from the group (Available for all fields).

· Max — SQL examines all values for this field and returns only the largest one from the group (Available for all fields).

· Sum — SQL examines all values for this field and adds the total. It then returns this value to the screen (Only available for numeric fields).

· Avg — SQL examines all values for this field and adds the total. It then divides the total by the number of records it added. It then returns this value to the screen (Only available for numeric fields).

Lastly, click the "SQL Statement" tab to see an additional option.

Modify this setting if you are using either Application Calculations or an External Object at *JCALCOBJ or *JREADRCRD and still want to use the GROUP BY functionality.

Note: Any Application Calculations or External Objects being called at *JCALCOBJ or *JREADRCRD will be computed only on a subtotal level.

How can I implement this in my Existing Applications?

To ensure compatibility with current applications, this functionality will only be available to you if you recompile your application and overwrite the HTML Presentation Layer and XML Properties File.

Additionally, you have the opportunity to copy an existing application to a new application.

Created: November 2, 2009 | Modified: July 16, 2013

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

Bootstrap Templates Compiling Database Summaries Application Properties Dates Video Production Calculations m-Painter Freemarker Email Admin App Properties Retrievals mrc-Productivity Series Dropdowns Graphing Record Selections Form Validation Graph Properties Java Popular Security Advanced Getting Started Maintainer RPG Retrieval Parameters SQL Administration External Objects Maintainers Tomcat Performance Prompt Screens Excel DB2 Graphs Report Build Process Data Dictionary Bar Graphs Reports

See all tags »

mrc

Build the custom apps and AI tools your business needs with m-Power, or have our Chicago-based team build them with you. One platform, one team that makes sure you succeed.

Since 1981 · 1,500+ customers · 4.7/5 on G2

m-Power
Overview Demos Build Process Licensing Specs Get a Demo
Solutions
Database Front-Ends Reporting AI Tools Dashboards ERP Enhancements Modernization See all solutions
Company
Case Studies Services About Blog Careers Contact Support

Privacy Policy Cookie Policy Cookie Settings

michaels, ross & cole, ltd. (mrc)
US: 2001 Midwest Road, Suite 310, Oak Brook, IL 60523 · 630-916-0662
UK: Mortlake Business Centre, 20 Mortlake High Street, London, SW14 8JN · +44-20-335-59566
© mrc. All rights reserved.