I have a hash like below:
{
'3.2':{
'abc-4536':{
"a" : "sfsdfs",
"b" : "qweqda",
"pa": "Printer"
},
'abc-2345':{
"a": "sdfswer",
"b": "werwewe",
"pa": "NewsPaper"
},
'abc-4536':{
"a" : "sfsdfs",
"b" : "qweqda",
"pa": "Printer"
},
...
}
}
So, now i have to arrange it like this:
{
'3.2':{
"Printer":{
'count': 2
},
"NewsPaper":{
'count': 3
},
}
}
i have to count and group by "pa" key inside '3.2'. Any ideas ?