let x = [{'abc': 1, 'qwe':2},{'abc': 2, 'qwe':2},{'abc': 5, 'qwe':null}, {'abc': 4, 'qwe':null}],
let result = _.chain(x)
_.groupBy(qwe)
_.map((value, key) => ({
name: key,
data: _.map(_.filter(value, item => {
return item.qwe;
})
'qwe'
)
})).value()
})
output is:
qwe:[2,2,5]
Expected output is:
qwe:[2,2,5,0, 0]