Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: has the Key of the Group been considered passed into aggregations as part of function signature #63

Open
itozapata opened this issue Oct 28, 2022 · 0 comments

Comments

@itozapata
Copy link

I ran into a situation where when i am using a groupAll with a grouping function involved to gather up all of the values of a string but it would be useful for filtering out duplicates if i knew what key i was working on as part of the dimension during aggregation... something that i am paraphrasing as what follows

const dimensionIncoming = crossfilterData.dimension((d) => d.incoming)

const group = dimensionTrain.groupAll()
const reducer = reductio().groupAll((record) => {
    return [record.incoming, record.outgoing]
})

reducer
      .value('incorrect')
      .filter((d, key) => {
        return d.incoming !== d.outgoing && d.incoming === key
      })
      .dataList(true)

the values in incoming and outgoing overlap but i am trying to get the stats of a given incoming value and what ends up happening is that because incoming / outgoing can be the same value it ends up duplicating the row. i can kinda use exception but it still has the same problem that i cant correctly filter out the things that have the key value only in outgoing which should not be part of the statistics on the key.

I realize that this is mainly a problem because im using the key value as part of the groupAll but in my particular use case it ends up working out that this makes sense to do and that the missing piece is that key value that is the dimension value. I also tried using the crossfilter.accessor(d) but that is telling me what the dimension value of this data item is not what group im currently working on unfortunately.

my ultimate solution was to simply do the incoming != outgoing without the key and then post process the results to add the behavior of trimming the list for the correct key matching strategy. while this works i gather that it would benefit from the performance that crossfilter already provides.

any advice or thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant