I'm building a simple app to track down all the purchase done by my business and I also want to track the total purchase done every month.
{
"id": 264,
"Name": "Item 1",
"Price": US$ 15,
"Date": 12 May 2015
}, {
"id": 63,
"Name": "Item 3",
"Price": US$ 12,
"Date": 19 May 2015
}, {
"id": 16,
"Name": "Item 1",
"Price": US$ 22.5,
"Date": 21 May 2015
}, {
"id": 4,
"Name": "Item 2",
"Price": US$ 27.75,
"Date": 21 May 2015
}, {
"id": 4,
"Name": "Item 2",
"Price": US$ 27.75,
"Date": 6 June 2015
},
I need to display the sum of purchase made for each month
{
"Month": "May",
"Total": 77.25
}, {
"Month": "June",
"Total": 27.75
}
whenever a new item is added the total amount of each month should be updated real time
If your data are in following Form :
You can use Following Aggregation Function :
Output :
Replace Month index with string later.