24
Sun, Nov
1 New Articles

TechTip: Know the Drill!

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

 Enhance your DB2 Web Query reports by using drill-down capabilities.

 

Hopefully, by now you've had a chance to install and use the new DB2 Web Query for System i tool. Hailed as the successor to the popular Query/400 product as the strategic System i query and reporting tool, DB2 Web Query can do things that Query/400 could only dream of. One of these advanced features is drill-down: the ability to select a column in a high-level (summary) report and click through (drill down) to show the next level of detail in another report.

 

Two types of drill-down capabilities can be implemented with DB2 Web Query:
  • Programmatic drill down—This requires developing at least two reports: a high-level summary report (also called the parent) and a detail report to link to (the child). The parent report contains the information necessary to link to the child report. The child report could in turn drill down to another linked report to reveal the next level of detail. Each new level of drill-down requires the creation or existence of another linked report
  • OLAP—The drill-down feature is enabled by using predefined levels of an OLAP hierarchy and activating the OLAP feature in the report options. With this method, the report developer is only required to create one report that is OLAP-enabled. All linked reports are based on the OLAP hierarchy structure and are generated automatically by DB2 Web Query. This method is not available with the DB2 Web Query base product. It requires the purchase of the OLAP add-on option (IBM product 5733QU2 option 2).

 

In this TechTip, I'm going to focus on the programmatic method. I'll explain how you can change your existing reports to take advantage of drill-down, and I'll include steps on passing parameters so that your reports can filter the data using other columns in the report.

 

To demonstrate DB2 Web Query's drill-down capability, let's start with a simple example of a high-level summary report. This report, called Revenue and Profit Summary, is shown in Figure 1.

 

figure_1--cobb121407.gif

 

Figure 1: Here's our example summary report. (Click images to enlarge.)

 

As the name would suggest, this report shows revenue and gross profit totals from the orders table, aggregated and sorted by country. Notice that the report also has two input parameters to filter the data by a specified date range.

 

This is a useful report, but it doesn't reveal much detail. For that, we have another report titled Revenue and Profit Detail Report (Figure 2).

 

figure_2--cobb121407.gif

 

Figure 2: This report detail shows more detail.

 

This report shows similar information but at the next level of detail (by region and state). It also includes additional fields for gross profit margin, provides conditional styling to highlight high and low gross profit margins, and is aggregated horizontally by the ORDERDATE_YEAR column. Notice that this report also includes input parameters for filtering the data by date range and a parameter to filter by country.

 

While these two reports may satisfy the reporting requirements, the problem is the lack of flow and efficiency from the user's perspective. After selecting the summary report and specifying the date range parameters, the user may view the results of the report and decide that the next level of detail is needed. This requires selecting the other report from the DB2 Web Query navigation menu and then re-specifying the date range parameters as well as selecting one of the countries from the drop-down list.

 

Wouldn't it be nice if the two reports could be linked so that all this could be accomplished with a single click of the mouse? Well, they can be! By making a few changes to the reports, you can quickly and easily enable drill-down to make your reports more efficient and useful. Let's begin by examining the design of the detail report.

 

1.                  Open this report in the Report Assistant tool and select the tab titled Selection Criteria.

What we are looking for here are the names and the order of the input parameters. They are circled in Figure 3.

 

figure_3--cobb121407.gif

 

Figure 3: Find the names and the order of the input parameters.

 

2.                  Record the names of these parameters because they will be specified later when modifying the summary report. Be aware that parameter order, spelling, and case-sensitivity are relevant.

Now that we know the names and order of the detail report's selection criteria parameters, we're ready to make changes to the summary report.

 

3.                  Exit this report and open the summary report in Report Assistant.

 

4.                  From the Field Selection tab, highlight the column named COUNTRY in the Sort By panel and click on the twisty button titled Show – Field Options – COUNTRY (Figure 4).

 

figure_4--cobb121407.gif

 

Figure 4: In the summary report, show field options.

 

You will see the expanded Field Options panel for the column COUNTRY.

 

5.                  Click on the Drill Down button as shown in Figure 5.

 

figure_5--cobb121407.gif

 

Figure 5: Click on the Drill Down button.

 

6.                  From the drill-down dialog window, select the radio button Execute Procedure (FOCEXEC). This action will cause a list of the reports in the current domain to be loaded into the dialog window.

 

7.                  Expand the domain and folder tree until you see the name of the detail report (Revenue and Profit Detail Report). Select this report (Figure 6).

 

 figure_6--cobb121407.gif

 

Figure 6: Select report to link to.

 

Once selected, the name of the procedure will be loaded into the Execute Procedure field.

 

Next, we need to add the parameters to pass to the linked detail report. For this, we'll use the parameters that we recorded previously. Make sure the parameter order, spelling, and case match exactly what is specified in the detail report.

 

The first parameter is for the COUNTRY column. The value passed to the linked report will be the one selected by the user during the act of drilling down.

 

8.                  From the drill-down dialog window, click the Add button and specify the following:

 

·        Enter COUNTRY for the parameter name.

 

·        Select the Field radio button under Parameter Value.

 

·        Select COUNTRY from the field drop-down list.

 

·        Click OK.

 

The next two parameters will be the beginning and ending order dates. Because these values are prompted for and specified in the summary report, they can be passed to the linked report, eliminating the need to prompt for them again. Passing selection criteria parameters from one report to another is somewhat esoteric. The trick is to specify the parameter names as constant values and precede them with an ampersand. This is shown in Figure 7.

 

9.                  Back on the drill-down dialog window, click the Add button and specify the following for the beginOrderDate parameter:

 

·        Enter beginOrderDate for the parameter name.

 

·        Select the Constant radio button under Parameter Value.

 

·        For the constant value, specify the &beginOrderDate.

 

·        Click OK.

 

figure_7--cobb121407.gif

 

Figure 7: Pass input parms from summary to detail report.

 

10.              Repeat step 9 for endOrderDate.

 

When you're finished, the drill-down dialog should look like the example shown in Figure 8.

 

figure_8--cobb121407.gif

Figure 8: Your drill-down dialog should look like this.

 

That's it! The reports have been linked and drill-down enabled, and parameters have been passed. The new reports are ready to be put to the test. 

 

After running the modified Revenue and Profit Summary Report, it should look like the example shown in Figure 9.

 

figure_9--cobb121407.gif

 

Figure 9: The summary report is now drill-down enabled.

 

It should look essentially the same as it did before with one exception: When you hover over the Country columns, notice that they are "hot" and can be clicked. Doing so drills down to the next level as shown in Figure 10.

 

figure_10--cobb121407.gif

Figure 10: Here's the result of the drill-down.

 

If you're prompted for any parameters after you click to drill down, this is likely caused by a parameter mismatch. Go back and verify that the parameters recorded in Step 2 have the exact same order, spelling, and case of the parameters entered in steps 8 through 10. 

Summary

The ability to create drill-down enabled reports in DB2 Web Query is just one of the many tools available in this feature-rich product. For more information on the product, download the IBM Redbook titled Getting Started with DB2 Web Query for System i.

 

Gene Cobb

Gene Cobb is a DB2 for i5/OS Technology Specialist in IBM's ISV Business Strategy & Enablement for System i group. He has worked on IBM midrange systems since 1988, including over 10 years in the IBM Client Technology Center (now known as IBM Systems and Technology Group Lab Services). While in Lab Services, he assisted customers with application design and development using RPG, DB2 for i5/OS, CallPath/400, and Lotus Domino. His current responsibilities include providing consulting services to System i developers, with a special emphasis in application and database modernization. He can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: