Comments (5)
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.
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.
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.
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.
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)
- Bug in Method "FromCSV" HOT 1
- How to copyFromDictionary? HOT 3
- 2d Array , add columns or join new array HOT 1
- [BUG] Doc. page ArrayType Get Accessor does not link back to ArrayType Overview HOT 1
- [BUG] Doc. page ArrayType Let Accessor does not link to Items setter page
- Last item Shift gives Length 1 HOT 1
- Handle multiarea ranges with FromExcelRange HOT 1
- Remove method it doesn't remove the only element of a 1 length array HOT 2
- Sorting in reverse, #9 review HOT 4
- Performance Issue HOT 24
- Add iterable support HOT 5
- Unexpected result on the "Splice" method
- [BUG] HOT 7
- Bug HOT 1
- Docs mistake HOT 1
- Out of string memory error [170+ MB CSV] HOT 7
- [BUG] Empty items after Concat HOT 1
- MultidimensionalArray Push HOT 1
- can betterarray sort descending? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vba-better-array.