Code Monkey home page Code Monkey logo

Comments (5)

ws-garcia avatar ws-garcia commented on May 23, 2024

Apparently, there is no options to filter 2D arrays. How ever, you can contribute with this great project or to find an alternative one.

from vba-better-array.

Senipah avatar Senipah commented on May 23, 2024

I originally had it recursing through each item in 2d arrays to filter entries individually. Why I took that approach IDK. Seems like filtering 2d arrays by column index is probably more useful. Will add now. Docs to be updated shortly... :)

from vba-better-array.

Senipah avatar Senipah commented on May 23, 2024

Change included in v1.8.0. Test coverage included by may require more. Will look at adding further coverage tomorrow/this weekend when I update the docs.

from vba-better-array.

mehrlander avatar mehrlander commented on May 23, 2024

Great to hear. Using an index makes sense to me, as long column names aren't available.

I confirmed that I was able to run a basic filter. I think a question for next steps is whether it could a.) allow for "like" filtering with wildcards or "contains" filtering (the latter in the style of native VBA filter()), and b.) filtering on multiple columns, but that is tricky to manage intuitively, as full functionality presumably required "and" versus "or" chaining. Presumably that rabbit hole is why Excel has its standard of no more than 2 filter criteria.

Without "like" or "contains" filtering, I suppose one can add a helper column (loop through the array using InStr() or Like on each element in the desired column to create a new column of booleans) and then filter on the helper column. That approach can also be used for multiple conditions. I have not gotten far enough to see whether BetterArray would make that easier.

Apologies if this is the wrong place to put it, but I was also confused by the use of "recurse" and "recursive" in several methods. I understand recursion as calling a function within itself. There is a reference to nested arrays, and I could also see how dealing with nested arrays might use recursion (say, to list out all elements in an array and any subarrays, like recursive directory listing functions). Is that the idea? Personally I can't imagine working much with nested arrays (I kind of love the "tidy data" concept of one-record = 1 row popularized by "tidyverse" in R), but if I did, my intuition tells me it would be unlikely that I would want to run the same function across nested levels. Granted: I may have misunderstood, or I may just be unaware of the use cases, but possibly if it is confusing to me it may be to others as well, FWIW.

from vba-better-array.

ws-garcia avatar ws-garcia commented on May 23, 2024

I confirmed that I was able to run a basic filter

To achieve this goal, you need a specialized piece of code that provides a source of expression evaluation. Therefore, you can achieve your goal by combining VBA Better Array and the selected expression evaluator.

This way you can filter arrays by multiple columns with a relatively infinite amount of filtering levels/conditions.

from vba-better-array.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.