killbill-memoizeit

analytics: iteration on current queries Signed-off-by:

5/16/2013 10:54:11 PM

Details

diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/cancellations_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/cancellations_per_day.sql
index 2ac5cdb..1bba486 100644
--- a/osgi-bundles/bundles/analytics/src/main/resources/reports/cancellations_per_day.sql
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/cancellations_per_day.sql
@@ -3,9 +3,8 @@ select
   date_format(next_start_date, '%Y-%m-%d') as day
 , count(*) as count
 from bst
-where next_start_date > date_sub(curdate(), interval 90 day)
-and next_start_date <= curdate()
-and event = 'CANCEL_BASE'
+where event = 'CANCEL_BASE'
+and report_group = 'default'
 group by 1
 order by 1 asc
 ;
diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/conversions_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/conversions_per_day.sql
index 7f0b398..d6de2c6 100644
--- a/osgi-bundles/bundles/analytics/src/main/resources/reports/conversions_per_day.sql
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/conversions_per_day.sql
@@ -3,11 +3,9 @@ select
   date_format(next_start_date, '%Y-%m-%d') as day
 , count(*) as count
 from bst
-where next_start_date > date_sub(curdate(), interval 90 day)
-and next_start_date <= curdate()
-and event = 'SYSTEM_CHANGE_BASE'
-and prev_phase = 'TRIAL'
-and next_phase = 'EVERGREEN'
+where prev_phase = 'TRIAL'
+and next_phase != 'TRIAL'
+and report_group = 'default'
 group by 1
 order by 1 asc
 ;
diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/new_accounts_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/new_accounts_per_day.sql
index 46c30c8..1b2e0e4 100644
--- a/osgi-bundles/bundles/analytics/src/main/resources/reports/new_accounts_per_day.sql
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/new_accounts_per_day.sql
@@ -3,8 +3,7 @@ select
   date_format(created_date, '%Y-%m-%d') as day
 , count(*) as count
 from bac
-where created_date > date_sub(curdate(), interval 90 day)
-and created_date <= curdate()
+where report_group = 'default'
 group by 1
 order by 1 asc
 ;
diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/new_trials_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/new_trials_per_day.sql
index 674f8ea..43d4576 100644
--- a/osgi-bundles/bundles/analytics/src/main/resources/reports/new_trials_per_day.sql
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/new_trials_per_day.sql
@@ -3,9 +3,9 @@ select
   date_format(next_start_date, '%Y-%m-%d') as day
 , count(*) as count
 from bst
-where next_start_date > date_sub(curdate(), interval 90 day)
-and next_start_date <= curdate()
-and event = 'ADD_BASE'
+where event = 'ADD_BASE'
+and next_phase = 'TRIAL'
+and report_group = 'default'
 group by 1
 order by 1 asc
 ;