Filter by Column : Powerful filtering/searching tool for all columns

That's not a bug. The dialog remembers the last position and size used, because there are people who find it useful to put it in a specific place and with a size different from the original. Just don't resize it at that width if you don't need it to.

(Also you should not change the command's name as it could cause potential errors, not to mention it's a bit rude towards the developer)

Well, thank you very much for your answer.

I'm sorry about the name change. Just because the command name FilterbyColumn is too long, I want to simplify it, no other purpose

errante, what a very useful and full-featured script you have created. It is particularly attractive to any who often use the AutoFilter function in Excel. Hell; it is even better, as Autofilter does not allow multiple layers of filters, to arrive at just the sub-set of, in this example, the two DLLs that are of an age and size. (And Excel's regular filter's cumbersome nature dissuades regular use).

Nice work. Another great addition to a great product.

DaveM

1 Like

Thank you very much for this script.
I found time to install this today and have it working.
I have much to learn about this.
It shows wonderful attention to detail.
I am also using @lxp evaluator playground.
Maybe someday they will become one script ?
I like both of them !

Forgive my ignorance but where and do you put this code so that it becomes visible in the context menu:
@label:=format(original_label, %headername%)
@hideif:=%headerindex% == -1 or %headerkey%=="index"
FilterbyColumn DIALOG=%headerkey%

Settings - Customize Toolbars and Keys... - Context Menu - Column Header

You can copy and paste this buttoncode with right click:

<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" separate="yes" textcol="none">
	<label>Filter by &apos;%1&apos;</label>
	<icon1>#quickfilter</icon1>
	<function type="normal">
		<instruction>@label:=format(original_label, %headername%)</instruction>
		<instruction>@hideif:=%headerindex% == -1 or %headerkey%==&quot;index&quot;</instruction>
		<instruction>FilterbyColumn DIALOG=%headerkey%</instruction>
	</function>
</button>

Thank you for that concise explanation it is much appreciated. However, in the video, our friend shows that instead of holding down the CTRL key and right click (which over time I will forget nodoubt) he seems to have somehow included a context menu item that does the same thing i.e. highlights the entire column that one would like to filter on. That is what I now don't know how to do.

I don't know how the highlighting was introduced in the video.
Maybe we can get that part later.

To add the posted button to the context menu:

  1. Enter Customize mode.
  2. Within the customize GUI select the Context Menus tab.
  3. Either double click the Column Header entry or right click it and select Edit.
  4. Two choices:
    a) Right click the pop-up and insert a new button.
    b) Right click the pop-up and Paste the posted XML button already copied to your clipboard.
  5. Move the button to your desired location in the context menu.
  6. Exit Customize mode saving changes.

Then right click on the desired column header and enjoy !

Greetings. A small teaser that I was eager to share with the people who find this script useful.

Last night and this morning, I used my free time to include some BIG improvements:

FAYT :

  • Now you can check if a column has data or not, regardless of its type. To do that simply use <colname>=="" or <colname>!=""
  • You can now compare the value of a column with another column (with auto suggestions for names!), using <colname><operator>{columnkey}. Eg. $scp:exiftool/exif-datetimeoriginal!={datetaken}

COMMAND :

  • Redesigned DIALOG mode. Options for more advanced searches (search flags).
  • Data is loaded only once and kept in cache, so data that takes a long time to read is read only once, avoiding future timeouts.
  • Ported FAYT syntax to the search box in the dialog box :grinning:
    A video:

What do you think about the new additions and how are you using the latest beta?

4 Likes

For some reason, although I am using the latest beta aka v1.4.9 Beta 1 : ColSearch.opusscriptinstall. See screen shot attached. Despite that, I don't get the new filter drop down but only the older "more options" hyperlink? How do I fix that? Also, in the video, you show that instead of holding down the CTRL key and right click (which over time I will forget nodoubt) you seem to have somehow included a context menu item/switch in your context menu that does the same thing i.e. highlights the entire column i.e the column that one would like to filter on. That is what I now don't know, although I have carefully done what others have suggested, I don't how to include that option in the column header flyout but I suspect you may have a separate script to enable that feature, am I correct


?

Not yet published, I have to test it first.
I upload these videos mainly for ideas/suggestions.

I understand that you have a comprehensive list of filter options, which is great. However, could you add a feature that allows us to create a favourites list? This would save time and make the process less tedious for us as we often find ourselves searching for the same thing repeatedly. Having a favourites list would make it easier and quicker for us to access our most frequently used filter.

Do you mean being able to save the currently applied filter according to the column type? Or a filter applied to a specific column?

I usually focus on a specific column while filtering data. However, if the filter requires sub-filtering or other complex steps, I tend to use a similar filtering strategy for other folders. These multi-step processes can be time-consuming, so it would be beneficial to save them as favourites. Let's face it, humans are creatures of habit, and we tend to use well-rehearsed strategies repeatedly.

I can't think of a way to include that in the dialog (like Excel macros recorder?). When I developed it, I had in mind a more visual filtering experience, making decisions based on the results, so the query are not constant.

If you already know what you want to search for, you can create buttons that use the command with your query already defined.
(In beta 2, which I will release tomorrow or the day after, you can make multiple queries, similar to the Filter Bar with Evaluator, but with the syntax of this command. Eg. ext==jpg && created==thismonth)

Update v1.4.9 Beta 2 :

Needs at least DOpus v13.4.3

CHANGELOG

GENERAL :

  • Some changes in the code to support the new features.
  • Renamed flag Ignore non qualified items to Ignore undefined values.
  • Now you can check if a column has data or not, regardless of its type. For that simply use colname=="" or colname!="".
  • You can now compare one column with another (not available in Dialog Command mode). To do that use colnameoperator{othercolname}
    • In both cases, colname can be the column keyword or a custom name (or be ignored in implicit mode).
    • {othercolname} is a column keyword (only built-in ones are supported). Keywords are listed here.
  • Improved logic when you want to ignore unavailable (undefined) values. Should now work in all modes.
  • Other minor fixes.

COMMAND :

  • Redesigned DIALOG mode.

    • Major changes in data handling:

      • Values are now read only at the beginning, and kept in cache for future use. This may seem trivial, but it is a substantial improvement, as it avoids unnecessary reading (and consequent delay), so subsequent load times are greatly reduced, especially when using multiple files/values that take a long time to calculate.
      • The refresh button does not reread the data from the files (it only synchronizes the files in the tab with those in the dialog).
        • If you need to update the data (because of some change in the tab, like new items) you must refresh the tab, and the dialog will update the data (reread it from the files) automatically.
    • Ported FAYT syntax to the dialog's filter box

      • Allows to use the implicit FAYT mode when searching for matches in the dialog list
      • Cache data for quick comparison, so that unlike FAYT mode, the search is genuinely Find-As-You-Type
      • Regular expressions, complete words, case match and diacritics available (if the column is of text type)
    • Now includes built-in, Evaluator and Shell columns in the columns combobox.

    • Now has more options and uses icons instead of buttons.

    • Options to select all/invert/deselect list entries

    • Option to choose search type : FAYT Syntax or Filter as plain text

    • Option to use regular expressions, case match, whole word and diacritics (if applicable)

    • Option in configuration to change the method of custom columns obtention. By default use Rename Presets, which is a bit slower, but more consistent.

    • New hotkeys:

      • Alt + 1 to select all list entries.
      • Alt + 2 to invert selection.
      • Alt + 2 to deselect all list entries.
      • Escape to clear filter box content.
      • F9 to save the results to a collection and close the dialog.
      • Shift + F9 to save the results to a collection without closing the dialog.
    • The dialog now behaves better with tab events:

      • When switching to another tab, the dialog is disabled, and re-enabled when returning to the same tab.
      • Updates its data if the folder is read again.
      • It closes if the path is changed or the tab is closed.
    • You can edit the saved categories from the dialog by clicking on the pencil icon.

    • You can ignore empty values when searching by pressing the :no_entry_sign: button in the list header (similar to Ignore undefined values flag).

  • New argument : MULTI, allows to use multiple filters, referencing one or more columns, using logical operators && or ||. (Experimental, need more tests, be patient with this)

    • E.g. FilterbyColumn MULTI QUERY ext==exe && created>lastyear
    • In this mode, Evaluator and textual filters are used exclusively.
      • You must use parenthesis where applicable. To search for an operator or literal parenthesis, enclose the values in double quotes.
  • New argument : IGNOREEMPTY, similar to the Ignore undefined values flag. Can be combined with other arguments.

  • It should work now properly in Libraries as well (let me know if it doesn't)

TODO/IDEAS :

  • If you use the advanced dialog (via More Options), the options in the list are not updated to match the results. This is understandable, since the options were not supposed to be the necessary ones, but since it can cause some confusion I imagine that it should be updated as well... (done in beta 2)

  • Currently you get the values each time a column is accessed via the combobox. The ideal would be to do that once for all items (even if they are hidden) and then in subsequent calls, filter those not currently visible based on the values already calculated. As this implies more work on my part, it can be implemented in later versions (so use/change columns or refresh the dialog list when necessary, especially for custom columns that create a cache in an exotic way). (done in beta 2)

  • Implement timers for the three buttons at the bottom, this in order to avoid overloading Opus, since someone can think of pressing them continuously (not necessary in beta 2)

  • If the Lister is refreshed, update also the dialog ? (I'll have to see how complicated it would be to implement that). (done in beta 2)

  • Handle the Attributes column as multi value, with more friendly options (e.g. archive instead of a). (done in beta 1)

  • List Shell and Evaluator columns (done in beta 2)

  • Edit those categories saved from the dialog (done in beta 2)

  • Add more quick filters in More Options (I'm open to suggestions :blush:).

  • Translate missing strings to other languages in the dialog, for better immersion (you can help with this).

  • List Script columns (done in v1.6.0).

4 Likes

Update v1.4.9 Beta 3 :

GENERAL :

  • Improved filtering of nested items (either by expanded folders or grouped flat view) in all modes (except where Textual Filters are used, there is no possibility in there). Now the command is able to show matches in these cases, showing also the ancestor folders.

DIALOG :

  • Now you can use a number as value, referring to the number that occupies the column (zero based index) in the current Lister (eg. DIALOG=3).
  • Now if DIALOG is used without values, or with an unsupported column name, fallbacks to 'Name' column instead of closing.
  • When getting values for custom columns, now does not show an error for each item in case the column does not exist (very rare but possible).
  • Fixed an error in columns with multiple values always showing "no value".
  • Possible Workaround when trying to select nested items from the dialog. Now, to show them, it also shows their ancestor folders.
  • Improved use of 'AND' for multi-value columns.
  • Improved the case of 'Genres', that in despite of being a multi-value column, it has a separator different from the rest.

KNOW ISSUES :

  • The command works very randomly in Libraries when nested items are involved. Since the workarounds I have implemented do not always work 100%, I think this is the best that can be achieved in terms of compatibility at this point.
  • If there are expanded folders, sometimes, after hiding/showing items, not all items are shown again. This seems to be a problem with the Select command, not with this command alone.

(I have not received any reports of any errors of any kind, so I imagine that there are no others bugs, or that nobody uses the command :slightly_smiling_face: :neutral_face:).

3 Likes

There is much I do not know yet about your script, but I congratulate you on your achievement.
Filtering expanded folders is almost working now. I have found one issue, but as is posted above, you may already know of it.

To simplify the discussion I am using only two expanded folders.
If a value is selected that is in both folders all works well.
Selecting a value that is only in one folder after a value has been selected that is in both folders also works.

However, when a value is selected that is only in one folder and then selecting a value that is in both folders, does not display the shared value in the other folder.

If you press F9 or shift + F9, and the correct files are stored in the collection, the problem is related to the Select command, already reported here

Yes !
The correct files are stored in the collection.
It is the same problem.