<query>
	<title>Most common exit pages</title>
	<withpageviews>true</withpageviews>
	<withactions>false</withactions>
	<columns>
		<!-- TODO: Allow UrlPath and UrlQuery as text columns in function to concatenate them -->
		<column>
			<source>UrlPath</source>
			<title>Seite</title>
			<group>1</group>
		</column>
		<column>
			<source function="true">CAST(IFNULL(SUM("ExitPage"), 0) AS real) / COUNT(*)</source>
			<alias>ExitRatio</alias>
			<title colspan="2">Ausstiegsrate</title>
			<format>%p</format>
			<sort dir="desc">1</sort>
			<align>right</align>
			<pgfilters>
				<filter op="gt" value="0" int="true" />
			</pgfilters>
		</column>
		<column>
			<barsource>ExitRatio</barsource>
			<title></title>
			<width>80</width>
			<color>#4cc12f</color>
		</column>
		<column>
			<source function="true">COUNT(*)</source>
			<alias>PageviewsCount</alias>
			<title>Seiten-~aufrufe</title>
			<align>right</align>
			<total>sum</total>
			<format>%d</format>
			<sort dir="desc">2</sort>
		</column>
		<column>
			<source function="true">CAST(IFNULL(SUM(CASE WHEN "EntryPage" AND "ExitPage" THEN 1 ELSE 0 END), 0) AS real) / COUNT(*)</source>
			<alias>BounceRatio</alias>
			<title colspan="2">Absprungrate</title>
			<format>%p</format>
			<align>right</align>
		</column>
		<column>
			<barsource>BounceRatio</barsource>
			<title></title>
			<width>50</width>
			<color>#d25548</color>
		</column>
		<column>
			<source function="true">SUM("ActivityTimespan") / COUNT(DISTINCT "SessionId")</source>
			<alias>AvgActivity</alias>
			<title colspan="2">Durchschnittliche~Besuchsdauer</title>
			<align>right</align>
			<format>%m:%2e</format>
			<null>(unbekannt)</null>
			<total>avg</total>
		</column>
		<column>
			<barsource>AvgActivity</barsource>
			<title></title>
			<width>50</width>
			<color>#b85ec2</color>
		</column>
	</columns>
</query>
