1
votes

I have data in the form {date, testscript, testcase, duration, clickcount}

I want to filter on testscript and date then get a count.

Like a distinct from testscript and date together:

X-Axis ManualTest: it should be 5, not 10 because there are always two records with the same date and testscript

X-Axis ErrorTest: it should be 2

How do I achieve this?

1
Your JSFiddle is broken because the external resources are loaded in the wrong order. If you can fix it, by re-adding the resources in the right order, that'd be great. What you are trying to do is count unique dates for each type of test? If so, Reductio can help with this: github.com/crossfilter/…Ethan Jewett
Hi Ethan, yes you're right i want to count unique dates for each type of test its like i want to count only the combination -> maybe 2011/11/11,Test script : ErrorTest, Testcase AA AND 2011/11/11,Test script : ErrorTest, Testcase BB this this should be count as 1 because same date same testscriptShalomi90

1 Answers

2
votes

As mentioned above, you should probably use a helper library like Reductio to do this. In Reductio, you use exception aggregation:

var clickcountGroup = reductio()
  .exception('date')
  .exceptionCount(true)(testcaseDim.group());

 testcaseRow
    .margins({ top: 5, left: 10, right: 10, bottom: 20 })
    .dimension(testcaseDim)
    .group(clickcountGroup)
    .valueAccessor(function(d){ return d.value.exceptionCount; })
    .elasticX(true);

https://jsfiddle.net/esjewett/4r9t3ozr/