Filtering Json data and summing it up

Posted by Vishalneeraj-24503 under JavaScript on 1/4/2018 | Points: 10 | Views : 211 | Status : [Member] [MVP] | Replies : 0
Hi All,

I have a Json data like below :-

var tempData =[{"url":"http://google.com","yyyy_mm":"2017-12","skills":"C#","count":3},
{"url":"www.yahoo.com","yyyy_mm":"2017-12","skills":"asp.ner","count":4},
{"url":"yahoo.com","yyyy_mm":"2017-12","skills":"vb.net","count":10},
{"url":"yahoo.com","yyyy_mm":"2017-11","skills":"vb.net","count":5},
{"url":"yahoo.com","yyyy_mm":"2017-11","skills":"vb.net","count":6},
{"url":"yahoo.com","yyyy_mm":"2017-11","skills":"vb.net","count":10},
{"url":"yahoo.com","yyyy_mm":"2017-10","skills":"vb.net","count":11},
{"url":"yahoo.com","yyyy_mm":"2017-10","skills":"json","count":100}]


I have to filter through 'yyyy_mm' column and calculate sum of 'count' column like
suppose, yyyy_mm = 2017-12 then count would be 17
similarly for 2017-11, count would be 21
and for 2017-10, count = 111 and so....
and again create the new json data.
How to accomplish this?
Thanks in advance.





Responses

(No response found.)

Login to post response