Formatted Totals on Queries / Drill down to filtered details

Contains tips for configurators working with Aware IM
Post Reply
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Formatted Totals on Queries / Drill down to filtered details

Post by tford »

I've come up with a way to easily show totals on a query that line up with the detail columns. See line 4) below.

Image

In setting up the BO to calculate and display this summary, I added an attribute to indicate a total line. This attribute is also used in Styles of each line in the query to apply bold formatting for total lines.

Below are the instances of the BO used to drive the query.

Image

When the "Description Bold?" attribute = Yes, the "Count" column values summarize all the other values of each query column.

Rule to calculate the Totals line:
If Totals_4_No_App_Tested.Category='4 Totals' Then
Totals_4_No_App_Tested.Students_1_Yes=SUM Totals_4_No_App_Tested.Students_1_Yes WHERE (Totals_4_No_App_Tested.Description_Bold_YN='No')
Totals_4_No_App_Tested.Students_2_No=SUM Totals_4_No_App_Tested.Students_2_No WHERE (Totals_4_No_App_Tested.Description_Bold_YN='No')
Totals_4_No_App_Tested.Students_3_Maybe=SUM Totals_4_No_App_Tested.Students_3_Maybe WHERE (Totals_4_No_App_Tested.Description_Bold_YN='No')
Totals_4_No_App_Tested.Students_4_NotAtPSD=SUM Totals_4_No_App_Tested.Students_4_NotAtPSD WHERE (Totals_4_No_App_Tested.Description_Bold_YN='No')

Rule to calculate the details lines of the query (not totals):
If Totals_4_No_App_Tested.Category<>'4 Totals' Then
Totals_4_No_App_Tested.Students_1_Yes=COUNT Student WHERE (Student.T_020_PSD_Intent='Yes' AND Student.T_200_App_Status=Totals_4_No_App_Tested.Category AND Student.Current_Grade='8' AND Student.Status='Active')
Totals_4_No_App_Tested.Students_2_No=COUNT Student WHERE (Student.T_020_PSD_Intent='No' AND Student.T_200_App_Status=Totals_4_No_App_Tested.Category AND Student.Current_Grade='8' AND Student.Status='Active')
Totals_4_No_App_Tested.Students_3_Maybe=COUNT Student WHERE (Student.T_020_PSD_Intent='Maybe' AND Student.T_200_App_Status=Totals_4_No_App_Tested.Category AND Student.Current_Grade='8' AND Student.Status='Active')
Totals_4_No_App_Tested.Students_4_NotAtPSD=COUNT Student WHERE (Student.T_020_PSD_Intent IS UNDEFINED AND Student.T_200_App_Status=Totals_4_No_App_Tested.Category AND Student.Current_Grade='8' AND Student.Status='Active')


Drilling down to Filtered Details
When the magnifying class on any line is clicked, the user can drill down to see the underlying data supporting the totals. Below is a query showing the 62 records that are included in the "Totals" line. Note that the user can then use any of the 8 filters above the query when analyzing the underlying data:

Image



Result when filtering the 62 records to only include "Shadow = Yes" --> 26 records to view:

Image
Tom - V8.8 build 3137 - MySql / PostGres
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Note that this is part of a Dashboard view which has 4 different total queries across the top. Each of the total lines are clickable to drill down to underlying data. The Description of the total line clicked is always highlighted in yellow.

The section below the 4 totals shows the filtered drill down records:

Image
Tom - V8.8 build 3137 - MySql / PostGres
customaware
Posts: 2400
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

Gorgeous Tom. Nice solution.

Great to see you working so hard over the feastive season to give us the first Tip for 2015.

Happy New Year to you and hope it is a good one for all.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

I received a PM asking about how I did the filtering in this example.

Most of the concepts are covered in the sample BSV I posted in January 2014 at:
http://www.awareim.com/forum/viewtopic.php?t=6633

Note that the sample BSV will only work on version 5.8 and later.
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Nice

Post by hpl123 »

Nice solution and share Tom.
Henrik (V8 Developer Ed. - Windows)
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Post by Jaymer »

Yes, looks great, even though I cannot comprehend its Awesomeness
:)
Post Reply