TECHNICAL FIELD The present invention relates generally to the field of software applications. More particularly, the present invention relates to software applications that store and sort data, such as through data queries. More particularly still, aspects of the present invention relates to filtering of the data returned from query results.
BACKGROUND OF THE INVENTION In order to manage large quantities of data, computer software applications, such as spreadsheet and database applications have been developed to organize and store the data in a logical manner. Typical spreadsheet and database applications comprise a large number of records of information, wherein each record comprises a predetermined number of fields. In the context of a database, a database management system is typically used to provide the software tools to manipulate the database more simply. Example database management systems include Microsoft® Access, and Microsoft® SQL Server, among others. Databases generally allow users to establish complex data interrelationships that are not available in spreadsheets, which increases their power while also making database applications even more difficult for new users to master.
A typical database management system provides the user the ability to add, modify or delete data, and the ability to query, sort, or recombine records in the database. Moreover, the usual system also provides functionality related to maintaining the security and integrity of the database data.
Querying large quantities of data in a spreadsheet or database application can be a complex and daunting task, especially to new users. Determining how to specify a data query in a spreadsheet can also be difficult. Database applications can be especially difficult to use, since entire query languages are often used (such as Structured Query Language, or SQL) to enable more complex queries. The language of queries can be intimidating to new users, and thus a more user-friendly query interface is desirable.
It is with respect to these considerations and others that the present invention has been made.
SUMMARY OF THE INVENTION In accordance with the present invention, a computer-implemented method is provided for graphical formulation of filter queries. A signal is received to filter a table. Next, the context of a specified key field is analyzed, and a menu of filters based on that context is displayed. A filter selection is received, and the corresponding filter is created.
In accordance with other aspects, the present invention relates to a system for easy-to-use data filtering. A menu module maintains a menu of filters. A receiving module receives filter signals and selections from the menu of filters. A filter module performs filtering. A display module displays the menu of filters and filter results, and a context analysis module analyzes the context of a particular table cell or column.
In accordance with yet other aspects, the present invention relates to a method for the automated creation of filter queries. A data table is displayed. A signal to filter the table is received. The context of a specified column is analyzed, and a menu of filters is displayed based on that context. A filter selection is received, and a new filter is created and executed. The invention may be implemented as a computer process, a computing system or as an article of manufacture such as a computer program product or computer readable media. The computer readable media may be a computer storage media readable by a computer system and encoding a computer program of instructions for executing a computer process. The computer program readable media may also be a propagated signal on a carrier readable by a computing system and encoding a computer program of instructions for executing a computer process.
These and various other features as well as advantages, which characterize the present invention, will be apparent from a reading of the following detailed description and a review of the associated drawings.
BRIEF DESCRIPTION OF THE DRAWINGSFIG. 1 shows a database environment in which an embodiment of the present invention may be implemented. A tabular view contains unfiltered data. This tabular view of a database management system represents prior art.
FIG. 2 illustrates an example of a suitable computing system environment on which an embodiment of the present invention may be implemented.
FIG. 3 illustrates the operational flow of the operations performed in one embodiment of the present invention.
FIG. 4 is a block diagram illustrating the modules that comprise one embodiment of the present invention.
FIG. 5 illustrates an example screenshot where a signal to filter has been received, and a filter menu displayed. Unfiltered records may be seen in the background.
FIG. 6 illustrates another example screenshot wherein a particular filter is being selected from a filter menu.
FIG. 7 illustrates another example screenshot wherein the particular filter has been applied to the data, and the resulting filtered records can be seen.
DETAILED DESCRIPTION OF THE INVENTIONFIG. 1 illustrates a screenshot of a tabular view (also known as a table102) of a product order database within a database management system. The table102 includes a table comprised of multiple rows and columns of data. Each row of data generally comprises a single data record. Generally, each column of data in a database can be counted on to include data elements of a homogenous type. For example, theOrder ID column104 includes data elements in numeric format, theCustomer column106 includes data in the form of alphanumeric strings, theOrder Date column108 includes data in date format, and so on. One skilled in the art will appreciate that many other types of data can be kept in a database, and displayed using a table within a database management system.
Despite the deceptively simple visual presentation of data inFIG. 1, up until now users still have had to manually formulate queries in a suitably structured query language, generally by designing and typing in query commands. So while database management systems may offer a straightforward view of data, formulating effective queries has remained a difficult skill to learn for spreadsheet users new to the world of databases. By allowing “canned” (manufactured in advance) queries to filter data, and allowing a simple query interface, the present invention allows database and spreadsheet products to be more accessible than ever before to new users
Given that the present invention may be implemented as a computer system,FIG. 2 is provided to illustrate an example of a suitable computing system environment on which embodiments of the invention may be implemented. In its most basic configuration,system200 includes at least oneprocessing unit202 andmemory204. Depending on the exact configuration and type of computing device,memory204 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.) or some combination of the two. This most basic configuration is illustrated inFIG. 2 bydashed line206.
In addition to thememory204, the system may include at least one other form of computer-readable media. Computer-readable media can be any available media that can be accessed by thesystem200. By way of example, and not limitation, computer-readable media might comprise computer storage media and communication media.
Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.Memory204,removable storage208, andnon-removable storage210 are all examples of computer storage media. Computer storage media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed bysystem200. Any such computer storage media may be part ofsystem200.
System200 may also contain a communications connection(s)212 that allow the system to communicate with other devices. The communications connection(s)212 is an example of communication media. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. The term computer readable media as used herein includes both storage media and communication media.
In accordance with an embodiment, thesystem200 includes peripheral devices, such as input device(s)214 and/or output device(s)216.Exemplary input devices214 include, without limitation, keyboards, computer mice, pens, or styluses, voice input devices, tactile input devices and the like. Exemplary output device(s)216 include, without limitation, devices such as displays, speakers, and printers. For the purposes of this invention, the display is a primary output device. Each of these devices is well know in the art and, therefore, not described in detail herein.
FIG. 3 illustrates one embodiment of the invention in which a table is queried using context filtering. In one embodiment of the present invention,display table operation302 displays a table (such as table102 inFIG. 1). This table can include practically any type of data. Each column of data generally contains data of a single, homogenous data type, such as a series of dates, alphanumeric strings, or numbers.
Receiveoperation304 receives a signal to filter the table data when a user clicks on an appropriate graphical user interface (GUI) control sequence. In one embodiment of the present invention, right-clicking the mouse on a particular column or column header (that column designating the “key field,” described below) causes a signal to be sent to receiveoperation304. In an alternate embodiment of the present invention, left-clicking on a particular cell (the column the cell falls within then becoming the key field) in the table causes a signal to be sent to receiveoperation304. One skilled in the art will appreciate that any number of possible GUI controls or command sequences from an input device can be used to select data of a particular type. Examples include centering the mouse pointer on a given data element, column, or column header, accompanied by activating a certain mouse button. Alternatively, the keyboard could be used to make a selection. Alternatively still, a combination of keyboard, mouse, trackball, or other input device actions could be used to select a data element, column, or column header.
In one embodiment, receiveoperation304 may interpret the selection of a cell in a column as a signal to filter based on the entire column's contents. In an alternate embodiment, receiveoperation304 may interpret the selection of a cell in a column as a signal to filter based specifically on the contents of that particular cell. The column the selection corresponds to becomes the “key field”, which is the column whose value will be used to decide whether each given row is filtered or not. For example, in order to omit from the query results, or “filter out”, all orders from table of product order data that were placed before2004, then the “order date” column must necessarily be a key field for such a query.
When a particular cell is selected (versus an entire column), filter options incorporating the value within the cell are possible (e.g., see example inFIGS. 5, 6, and7, discussed later).
With respect to an alternative embodiment, data external to the data table can also be incorporated into a filter. For example, filtering out orders in an order data table from “Today” requires external data (namely, today's date) to be retrieved and incorporated into the query, since the current date and time are always changing and thus not practical to store in a data table.
After receiveoperation304 receives a signal to filter, analyzecontext operation306 analyzes the selected data cell or column to determine what type of data it contains. Data filters appropriate to the determined type of data may then be added to a filter menu502 (seeFIG. 5).
For example, if the data type is determined to be a date, one or more filters appropriate to dates will be added to the filter menu (see502,FIG. 5 for an exemplary filter menu). Such date-specific filter choices might include “Today,” which could be used to filter out all records that do not have a date matching today's date. Similarly, “Yesterday” and “Tomorrow” are also date-specific filter choices that could be added to a filter menu by analyzecontext operation304. Other date-specific filter choices might include “This week”, “Last month”, “Last quarter”, “This year”, etc. Yet other date-specific filter choices might include “Newer than” the date contained in a cell if a particular cell is selected, “Older than” the date contained in a selected cell, or “Same month” as the date contained in a selected cell.
In yet another embodiment, the filter based on dates may involve an “All Dates in Period” filter. For example, user options or choices for this type of filter might include “Quarter 1,” and/or “Quarter 2,” etc. to display all data associated with selected quarters, irrespective of the year. In yet another example, the choices may include months, such as “January,” “February,” “March,” etc. such that the user may choose these options to show only dates in the selected month period irrespective of the year value. As such, common applications might then review and filter the first quarter sales over the last 5 years or all the birthdays in a given month for these examples, respectively.
In a given embodiment, other type-specific filters may exist for other data types. For example, string-specific filters might include “Is,” which may filter out data records that do not match the string contained in a specified cell. Likewise, “is not” may filter out data records that do match the string contained in a specified cell. “Begins with” could be used to filter out records that do not contain a string beginning with a user-specified string, thus allowing for filtering by partially matching a given string. “Contains” may allow for a similar partial search, this type returning elements with strings that contain another given string. “Not blank” may filter out data records containing a blank string in a specified field.
In an alternate embodiment, a list of values appearing in the column is presented to the user. Next to each value is a checkbox, or other control allowing for binary selection. Records containing values that do not match the selected (checked) values will be filtered out.
In another embodiment, number-specific filters enable filtering based on the content of numeric fields. For example, “Smallest 25” may filter out all but the records containing key fields representing the smallest 25 values in a key field. Such a filter may return more than 25 records if a column containing non-unique numbers exists, since SQL reports all numbers that “tie” for highest or lowest status when comparing numbers. For example, filtering out all records but those corresponding to the smallest 25 customer postal zip codes could still include a great many customer records, as many thousands of customers could reside in each postal zip code. As a further example, “Largest 100” would filter out all but the records containing key fields representing the largest 100 values in a key field. “Greater than average” would compute the average of a column of numbers, and then filter out records less than or equal to that average. Similarly, “Less than average” would compute the average of a column of numbers, and then filter out records greater than or equal to that average. In another embodiment, the user could specify two numbers using a “Between” filter, and records containing values not in the range formed by the two numbers would be filtered out.
In yet another embodiment, percentiles could be used to filter numeric values. For example, “Smallest 5 percent” or “Largest 25 percent” could be used to filter numbers based on their value relative to the other numbers in a table.
In one particular embodiment of the present invention, a column containing cells with a very limited choice of values may cause analyzecontext operation306 to add the actual values to a filter menu. For example, a column that only allows “Yes” or “No” as possible values may cause analyzecontext operation306 to add “Yes” and “No” filter options to a filter menu.
One skilled in the art will appreciate that some filters may be appropriate to multiple data types. For example, “Equals” may be used to filter out all data records that are not equal to the contents of a selected cell. “Equals” may also be used to find a matching date, number, alphanumeric string, boolean value, etc.
In one embodiment of the present invention, analyzecontext operation306 may determine that no additional filters need to be added to a filter menu.
After analyzecontext operation306 adds any appropriate filters to a filter menu,display operation308 displays the menu of filters (for an example of a filter menu, see602 inFIG. 6). The menu of filters displayed bydisplay operation308 may include default filters appropriate for all data types (such as “Equals”, discussed above).
Once a filter menu has been displayed, receiveoperation310 receives a filter selection. In one embodiment, this selection is made by hovering a mouse pointer over a given filter in a filter menu, and slicking a mouse button. However, one skilled in the art will appreciate that any number of input device sequences could be use to select a filter from a filter menu without departing from the scope of the claimed invention.
After a filter selection has been received, determineoperation312 determines whether a filter already exists for a selected table column. If a filter does already exist for a selected table column, flow branches YES to removeoperation314. However, if no filter exists for a selected table column, flow branches NO to createoperation316.
In an embodiment of the current invention, two filters cannot be applied to the same table column, so if determineoperation312 determined that a filter already exists for a selected table column, then removeoperation314 is used to remove that filter to make way for a new one.
If no filter existed for the specified table column, or if a filter did exist and was removed byremove operation314, createoperation316 next creates a new filter. This new filter includes a query encoded in a query language, such as SQL.
In an alternative embodiment of the present invention, multiple filters can be applied to the same table column, as long as those filters are not mutually exclusive.
In an embodiment involving a database, a filter query may be created that incorporates an SQL “where” qualifier. A where qualifier, when added to an SQL query, may be used to conduct a search or narrow down the results of a query. For example, appending “where Country=Lithuania” to the end of an SQL query will cause the query to return only results whose Country column value is equal to “Lithuania”. Likewise, appending “where OrderID=41475” to an SQL query will cause the query to return only results whose OrderID is equal to 41475. In this way, the where qualifier can be used to return arbitrarily wide or narrow lists of records that match the query.
One skilled in the art will appreciate that, in addition to locating full matches, the where qualifier can also be used to find partial matches to query through the use of a regular expression, a search tool well known in the field. For example, a where query could be modified to query all records with a Country value starting with “L”. Likewise, specific ranges of numbers and/or dates can also be queried using the SQL where qualifier.
In another embodiment, a filter may incorporate an SQL “top” qualifier. This may be used to instruct a query to only return an arbitrary number of the top or bottom entries. For example, by adding Top (5) to a sales database query, only the top 5 sales figures will be returned for a given query instead of all sales. In the event of a tie, the exemplary sales database would return more than 5 records.
One skilled in the art will appreciate that the where and top SQL qualifiers are provided as exemplary embodiments only, and other query qualifiers could be used in constructing a query without departing from the scope of the claimed invention. Further, some embodiments involve a spreadsheet, which may lack a query language, and instead perform queries directly upon the data.
In one embodiment involving a database, a filter query containing the appropriate SQL qualifiers is created, and stored in memory for further modification and/or later use.
In one embodiment of the present invention, createoperation316 may also select a given filter on a filter menu by causing it to be highlighted whenever the filter menu is displayed.
After a filter is created, performoperation318 performs filtering based on that filter. In a database embodiment, the query created by createoperation316 is issued to the database by the database management system in a query language. In another embodiment, the filtering is performed directly by the application. The results may be stored in memory, or directed to display operation320 (discussed below) for rendering.
Display operation320 renders the query results yielded byperform operation318 on the screen. The results may be read from memory, piped directly todisplay operation320 byperform operation318, or otherwise transmitted to displayoperation320 for rendering. The results are rendered in place of the original, unfiltered table.
In an alternate embodiment of the present invention, the results may be rendered in an additional result table, which does not necessarily replace the original, unfiltered table.
In a particular embodiment of the present invention, a “clear filters” control exists which enables the user to erase all filters currently in effect. Optionally, the “clear filters” control may, additionally, reissue the current query with all filters turned off, and update the results on the screen accordingly.
FIG. 4 is a block diagram illustrating the modules that comprise one embodiment of the present invention. Anembodiment400 may communicate withmemory420 when executing a query, performing a filter query, or receiving the results of the filter query. Anembodiment400 also communicates with adisplay device430 in order to allow graphical selection of a cell, column, and filter, and to return results of a filter, among other things.
Amenu module402 maintains the filter menu for a particular table column. This may include adding contextually appropriate filter options to a filter menu, removing contextually inappropriate filter options to a menu, and ordering filter options in a filter menu.
A receivemodule404 receives signals to filter records and filter selections from a filter menu. Input may be received from a GUI, via keyboard input or other input device, or by automated script or macro.
Afilter module406 creates filters. In an embodiment involving a database,filter module406 also creates queries associated with the filters, and executes those queries. While SQL is the predominant query language in the database field, filter queries may be created in any query language including specialized versions of SQL such as HQL (Health Query Language), or query languages unrelated to SQL. Execution of a query may occur at the database management system level, or may be delegated to a lower-level program that accesses the database. Queries may be executed on the same system as the database management system is running, or sent out to one or more remote systems for execution. In the case of the latter, the remote system will return results, either directly or indirectly, to the database management system so that the results of the query may be displayed. Filters may also be applied directly to the data by a spreadsheet application, without the use of a query or a database management system.
A display module408 displays numerous aspects of the present invention. For example, display module408 may display a table in a spreadsheet or database management system. It may also display the menu of filters, discussed previously in conjunction withFIG. 3. Further, it may display the results of a filter in the form of a table, or other suitable format. Display module408 may interact withdisplay device430 to render an element that it is displaying.
Context analysis module410 analyzes the context of a particular cell or column in a data table. Appropriate (and inappropriate) filters may be derived using predetermined criteria (see discussion of analyzecontext operation306 in conjunction withFIG. 3) or other criteria.
FIG. 5 illustrates an example screenshot where a signal to filter has been received (not shown), and afilter menu502 displayed.Unfiltered records504 may be seen in the background, as a filter has not yet been selected from thefilter menu502. In the exemplary screenshot, thefilter menu502 was displayed when the user clicked on first a cell (not shown) in the Order Date column506 (thus selecting Order Date as a key field upon which the subsequent filtering will take place), and then on CommonFilters menu item508, although one skilled in the art will appreciate that this functionality could just as easily have been triggered by on a different cell or column and/or with a different menu item, button, mouse or keyboard sequence, or selection of a toolbar element without departing from the scope of the claimed invention.
FIG. 6 illustrates another example screenshot wherein aparticular filter602 is being selected from afilter menu604. In the exemplary screenshot, theparticular filter602 was selected by hovering a mouse pointer over it and left-clicking, although skilled in the art will appreciate that this selection could also made using other sequences and other input devices without departing from the scope of the claimed invention.
FIG. 7 illustrates another example screenshot wherein the particular filter (not shown; see602 in conjunction withFIG. 6) has been applied to the unfiltered data (not shown; see102 in conjunction withFIG. 1), and the resulting filtereddata702 can be seen. Theorder date column704 is shaded to draw attention to the fact that the filtereddata702 contains only records with an Order Date key field value in the month of May.
One skilled in the art will appreciate that while the exemplary embodiments deal with only one filter for the sake of simplicity, multiple filters applied to multiple columns may be in effect simultaneously, thus allowing interaction of filters to more precisely focus a filter query. One skilled in the art will likewise appreciate that while exemplary embodiments were presented in the contexts of a spreadsheet, and a database application, the invention could be used in any context where specific data must be selected from a dataset. Further, the resulting specific data need not be displayed. It could instead be saved to memory, sent to a printer, emailed, or otherwise directed without departing from the scope of the claimed invention.
The various embodiments described above are provided by way of illustration only and should not be construed to limit the invention. Those skilled in the art will readily recognize various modifications and changes that may be made to the present invention without following the example embodiments and applications illustrated and described herein, and without departing from the true spirit and scope of the present invention, which is set forth in the following claims.