Hello,
I’m currently learning and evaluationg Mongo Charts andI need help and/or advice in putting a Mongo Charts report together.
We have a mySql database that I’m now testing in Mongo Atlas. I’ve connected Charts to my collection and I’ve tried to genorate one of our campaign reports using the charts GUI however, I don’t yet understand how to create this report that is made up of 8 count queries.
Here is an example of the SQL that I need to do with Charts (or is there another tool to use first?):
select
(select count(StatID) form reports where subject like 'Ad Initialized') as Ad_Initialized,
(select count(StatID) form reports where subject like 'Click from Video') as Click_From_Video
(select count(StatID) form reports where subject like 'Enter_Checkout') as Enter_Checkout
(select count(StatID) form reports where subject like 'Details Submitted') as Details_Submitted
(select count(StatID) form reports where subject like 'Checkout') / (select count(StatID) form reports) as 'Conversion to Checkout'
(select count(StatID) form reports where subject like 'Order Successful') / (select count(StatID) form reports) as Order_Successful
The above SQL response gives me “counts for each sql statement” in one report. I would like to build this in Charts.
Here is the sample data. Values are not listed as the data is only a sample model.
Many thanks for your time and advise.
{
"_id" : ObjectId("613858b58bd4a6610a0a6e4d"),
"StatID" : 93413,
"SessionID" : "7sf6udr21m1qppa78geci84406",
"Subject" : "Product Details",
"SubjectID" : 84,
"Action" : "View Product",
"Ref" : null,
"EventData" : "Pizza PIZZA",
"DeviceID" : 1,
"CreatedDateTime" : ISODate("2020-05-17T17:57:53.000Z")
},
{
"_id" : ObjectId("613858b58bd4a6610a0a6eea"),
"StatID" : 93571,
"SessionID" : "uvutbu08rd8rvksu4cv328n821",
"Subject" : "Product Details",
"SubjectID" : 84,
"Action" : "View Product",
"Ref" : null,
"EventData" : "Gluten Free Foods",
"DeviceID" : 1,
"CreatedDateTime" : ISODate("2020-05-17T18:41:02.000Z")
},
{
"_id" : ObjectId("613858b58bd4a6610a0a6f1d"),
"StatID" : 93622,
"SessionID" : "uvutbu08rd8rvksu4cv328n821",
"Subject" : "Product Details",
"SubjectID" : 84,
"Action" : "View Product",
"Ref" : null,
"EventData" : "Pizza n Burgers",
"DeviceID" : 1,
"CreatedDateTime" : ISODate("2020-05-17T18:48:34.000Z")
}