Repository navigation
Can I apply a secondary filter in a macro to an already filtered database? #1167
|
In the GSAK MFILTER command, there is an optional argument join=and which allows you to apply an additional filter to an already filtered database (effectively adding and additional 'and xxxx' to the existing where clause). For example, if I wanted to filter a users already filtered list of caches for only those with corrected coordinates within the existing filter. Is it possible to do this with an opensak macro? |
Replies: 3 comments 3 replies
|
There is no local current = opensak.codes() -- caches of the active filter
local n = opensak.filter{ codes = current, corrected = true, label = "Filter + corrected" }
print(n) -- 0: nothing matched, the view is unchanged
|
|
Thanks. That should work. |
|
@GeePa67 if we see in the future that we should add that feature to OpenSAK let's open an issue. For the moment I assume the soltion by @zuhairhalawa works well btw Github know OpenSAK very well. On the top right you find a CoPilot link. When I add your question above I get a very nice soltution. Give it a try
|

There is no
joinargument.opensak.filter{}builds a new filter from the keys you pass (combined with AND, or OR withmode) and applies it; it does not extend the active one. You can get the same result in two steps, becauseopensak.codes()returns the GC codes of the caches in the active filter, andopensak.filter{}has acodeskey ("exactly these GC codes") that is ANDed with the other keys:corrected = trueis the filter key for caches with corrected coo…