<report>
<title>New Registrations</title>
	 
	<level>
		<title>Yearly Registration</title>
		<sql>SELECT from_unixtime(A.date_orig,"%Y") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
		<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
		<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		<indent>0</indent>
		<column>
			<display>Year</display>
			<field>yearmonth</field>
			<aggregate>true</aggregate>
			<visible>true</visible> 
		</column>
		<column>
			<display>Registrations</display>
			<field>total</field>
			<total>true</total>
		</column> 
	</level>			
	<break />
	<graph type="bar" title="" width="500" height="300">
		<dataset>
			<sql>SELECT from_unixtime(A.date_orig,"%Y") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
			<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
			<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		</dataset>
	</graph>
	<break />
	

	
	<level>
		<title>Monthly Registration</title>
		<sql>SELECT from_unixtime(A.date_orig,"%M, %Y") as yearmonth, count(A.id) as total, from_unixtime(A.date_orig, "%Y-%m") as orderby from %%AGILE_DB_PREFIX%%account A</sql>
		<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
		<orderby>GROUP BY yearmonth ORDER BY orderby ASC</orderby>
		<indent>0</indent>
		<column>
			<display>Month, Year</display>
			<field>yearmonth</field>
			<aggregate>true</aggregate>
			<visible>true</visible> 
		</column>
		<column>
			<display>Registrations</display>
			<field>total</field>
			<total>true</total>
		</column> 
	</level>			
	<break />
	<graph type="line" title="" width="600" height="300">
		<dataset>
			<sql>SELECT from_unixtime(A.date_orig,"%M, %Y") as yearmonth, count(A.id) as total, from_unixtime(A.date_orig, "%Y-%m") as orderby  from %%AGILE_DB_PREFIX%%account A</sql>
			<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
			<orderby>GROUP BY yearmonth ORDER BY orderby ASC</orderby>
		</dataset>
	</graph>	
	<break />		
	 
	<level>
		<title>Weekly Registration</title>
		<sql>SELECT from_unixtime(A.date_orig,"%Y-%u") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
		<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
		<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		<indent>0</indent>
		<column>
			<display>Year-Week</display>
			<field>yearmonth</field>
			<aggregate>true</aggregate>
			<visible>true</visible> 
		</column>
		<column>
			<display>Registrations</display>
			<field>total</field>
			<total>true</total>
		</column> 
	</level>			
	<break />
	<graph type="line" title="" width="800" height="300">
		<dataset>
			<sql>SELECT from_unixtime(A.date_orig,"%Y-%u") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
			<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
			<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		</dataset>
	</graph>	
	<break />
	
	<!--
	<level>
		<title>Daily Registration</title>
		<sql>SELECT from_unixtime(A.date_orig,"%Y-%m-%d") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
		<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
		<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		<indent>0</indent>
		<column>
			<display>Year-Month-Day</display>
			<field>yearmonth</field>
			<aggregate>true</aggregate>
			<visible>true</visible> 
		</column>
		<column>
			<display>Registrations</display>
			<field>total</field>
			<total>true</total>
		</column> 
	</level>			
	<break />
	<graph type="line" title="" width="800" height="300">
		<dataset>
			<sql>SELECT from_unixtime(A.date_orig,"%Y-%m-%d") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
			<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
			<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		</dataset>
	</graph>	
	<break />	
	-->
		
	<level>
		<title>Day of Week Registration</title>
		<sql>SELECT from_unixtime(A.date_orig,"%W") as yearmonth, count(A.id) as total, from_unixtime(A.date_orig,"%w") as orderby from %%AGILE_DB_PREFIX%%account A</sql>
		<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
		<orderby>GROUP BY yearmonth ORDER BY orderby ASC</orderby>
		<indent>0</indent>
		<column>
			<display>Day of Week</display>
			<field>yearmonth</field>
			<aggregate>true</aggregate>
			<visible>true</visible> 
		</column>
		<column>
			<display>Registrations</display>
			<field>total</field>
			<total>true</total>
		</column> 
	</level>			
	<break />
	<graph type="bar" title="" width="600" height="300">
		<dataset>
			<sql>SELECT from_unixtime(A.date_orig,"%W") as yearmonth, count(A.id) as total, from_unixtime(A.date_orig,"%w") as orderby from %%AGILE_DB_PREFIX%%account A</sql>
			<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
			<orderby>GROUP BY yearmonth ORDER BY orderby ASC</orderby>
		</dataset>
	</graph>	
	<break />			 
		 
	<level>
		<title>Hourly Registration</title>
		<sql>SELECT from_unixtime(A.date_orig,"%k") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
		<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
		<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		<indent>0</indent>
		<column>
			<display>Hour of Day</display>
			<field>yearmonth</field>
			<aggregate>true</aggregate>
			<visible>true</visible> 
		</column>
		<column>
			<display>Registrations</display>
			<field>total</field>
			<total>true</total>
		</column> 
	</level>			
	<break />
	<graph type="line" title="" width="800" height="300">
		<dataset>
			<sql>SELECT from_unixtime(A.date_orig,"%k") as yearmonth, count(A.id) as total from %%AGILE_DB_PREFIX%%account A</sql>
			<criteria>A.site_id = %%DEFAULT_SITE%%</criteria>
			<orderby>GROUP BY yearmonth ORDER BY yearmonth ASC</orderby>
		</dataset>
	</graph>	
	<break />		 
</report>
