Nov
19
comment group MongoDB collection by month and aggregate revenue for churn/revenue chart
i was hoping the graph makes it pretty visible what is needed, its hard to write down the exact data. for the graph for example you need 18 different sets, because its 18 different graphs stacked. 1 would be all orders of customers who had their first oder in the first month + all their recurring orders, their revenue grouped by month. then 2 would be everyone who had their order in the second month + all their recurring orders, their revenue grouped by month...etc in the excerpt we only have data for one graph which stars on month 1 but would even have a revenue of 32.45 in june/2014
Nov
19
comment group MongoDB collection by month and aggregate revenue for churn/revenue chart
basically its a different graph/dataset for every month since lauch. you take everyone who first ordered in month 1 (12/2010) and collect all their orders, then you sort them by month and sum the revenues. then you can see if today, there are still some of your month 1 customer adding any revenue to your monthly. the same you do for month 2,3 etc. if you stack all of them you have the above graph.
Nov
19
revised group MongoDB collection by month and aggregate revenue for churn/revenue chart
edited title
Nov
19
comment Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
i accepted your answer and created a follow up questions, as i figured its as complex as the one before :) see stackoverflow.com/questions/27021561/…
Nov
19
accepted Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
Nov
19
asked group MongoDB collection by month and aggregate revenue for churn/revenue chart
Nov
19
comment Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
thanks!, i now have the customers with total recurring order amounts and values. how would i add grouping by month/year? or how could i now perform an aggregate/grouping on that result list to see the avg amount of orders
Nov
19
comment Convert MongoDB console aggregate to php with array
awesome! thanks again!
Nov
19
comment Convert MongoDB console aggregate to php with array
a question aside. the results are pretty randomly sorted with the years and months changing. i tried to add a {$sort : { year: 1}} or month, it seems ot change the order but not for the better or actually really ASC/DESC. any clue how to properly sort the results?
Nov
19
accepted Convert MongoDB console aggregate to php with array
Nov
19
comment Convert MongoDB console aggregate to php with array
damn, thanks! this is kinda reminding me of university using scheme! too many brackets!
Nov
19
comment Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
its a collection, and its MongoDB shell version: 2.4.12
Nov
19
asked Convert MongoDB console aggregate to php with array
Nov
19
comment Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
var bulk = db.orders.initializeUnorderedBulkOp()returns Wed Nov 19 10:36:17.474 TypeError: Property 'initializeUnorderedBulkOp' of object churn.orders is not a function
Nov
19
comment Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
to his yes, but not to the returning customers revenue.
Nov
19
comment Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
thanks for your help. i found this for converting the string db.orders.find({net_revenue : {$exists : true}}).forEach( function(obj) { obj.net_revenue = new NumberInt( obj.net_revenue ); db.orders.save(obj); } );just with what i have to replace NumberInt? NumberDouble/NumberFloat doesn't work. Furthermore, i'd like to sum only over the returning orders, meaning excluding the first order
Nov
19
comment Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
i found this db.orders.find({net_revenue : {$exists : true}}).forEach( function(obj) { obj.net_revenue = new NumberInt( obj.net_revenue ); db.orders.save(obj); } ); to turn it into a Int, but NumberDouble is not defined.
Nov
19
asked Using MongoDBs aggregation, excluding sets from grouping and sum monthly revenues fails on $cond statement
Oct
29
awarded Popular Question
Sep
22
answered How can I add a ipfw forward rule to little snitch?
1 2 3 4 5