Well after searching like crazy and with the help of my boss and the SOLR mailing list i have managed to come up with a solution that i would like to post in case someone in the future needs to accomplish a similar thing.
What I ended up doing is using SOLR stats combined with facets to get the NetSales and TransCount for each day.
wt=json
&indent=true
&q=*:*
&fq=BusinessDateTime:[2012-03-01T00:00:0Z TO 2013-03-01T23:59:5Z]
&rows=0
&stats=on
&stats.field=NetSales
&stats.field=TransCount
&stats.facet=BusinessDateTime
Then in JSONiq i transform the data using this function:
import module namespace functx = "http://www.functx.com/";
variable $t := [data];
let $stats := $t("stats")
let $statFields := $stats("stats_fields")
let $transCount := $statFields("TransCount")
let $netSales := $statFields("NetSales")
let $netSalesFacets := $netSales("facets")("BusinessDateTime")
let $dates := jn:keys($netSalesFacets)
let $concat := for $sales in $netSalesFacets, $d in $dates, $trans in $netSalesFacets
let $dets := jn:value($sales, $d)
let $tranDet := jn:value($trans, $d)
return {
'Date' : $d,
'sum' : $dets("sum"),
'Tsum' : $tranDet("sum")
}
let $results := for $stat in jn:keys($statFields)
return $stat
return $concat
I still need to break out the actual data from the string however i already have that worked out just not implemented in the sample above. If you have stumbled across this and are in need of the additional code to convert the date to an actual date object and then get the month and year for grouping just throw a comment on here and ill update my solution or reply to your comment.