<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customReport pageSize="200" reportType="Linear">
    <reportName>Average time spend on portal</reportName>
    <reportDescr></reportDescr>
    <dbInfo>local</dbInfo>
    <dbType>mysql</dbType>
    <chartType>TimeSeriesChart</chartType>
    <chartMultiSeries>N</chartMultiSeries>
    <chartWidth>700</chartWidth>
    <chartHeight>300</chartHeight>
    <showChartTitle>false</showChartTitle>
    <public>true</public>
    <hideFormFieldAfterRun>false</hideFormFieldAfterRun>
    <createId>27</createId>
    <createDate>2017-01-28-05:00</createDate>
    <reportSQL>SELECT 
	d.dat audit_date, 
	'# of Minutes' app, 
	coalesce(diff, null, 0) mins 
from
(
	select * from
	(
	select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as dat
	from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a
	cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b
	cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c 
	) d where d.dat between date_add( curdate(), interval -30 day) and  curdate()
) d left outer join
(
	select dat, mi, mx, TIMESTAMPDIFF(MINUTE, coalesce(mi, null, 0), coalesce(mx, null, 0)) + 30  diff
	from
	(
		select DATE(audit_date) dat, coalesce(min(audit_date), null, 0) mi, coalesce(max(audit_date), null, 0) mx
		from fn_audit_log 
		where user_id = [USER_ID] and DATE(audit_date) between CURDATE()-300 and CURDATE()
		group by DATE(audit_date)
	) a
) a
on a.dat = d.dat
order by 1</reportSQL>
    <reportTitle></reportTitle>
    <reportSubTitle></reportSubTitle>
    <reportHeader></reportHeader>
    <frozenColumns>0</frozenColumns>
    <emptyMessage>Your Search didn't yield any results.</emptyMessage>
    <dataGridAlign>left</dataGridAlign>
    <reportFooter></reportFooter>
    <numFormCols>1</numFormCols>
    <displayOptions>NNNNNNN</displayOptions>
    <dataContainerHeight>100</dataContainerHeight>
    <dataContainerWidth>100</dataContainerWidth>
    <allowSchedule>N</allowSchedule>
    <multiGroupColumn>N</multiGroupColumn>
    <topDown>N</topDown>
    <sizedByContent>N</sizedByContent>
    <comment>N|</comment>
    <dataSourceList>
        <dataSource tableId="du0">
            <tableName>DUAL</tableName>
            <tablePK></tablePK>
            <displayName>DUAL</displayName>
            <dataColumnList>
                <dataColumn colId="audit_date">
                    <tableId>du0</tableId>
                    <dbColName>d.dat</dbColName>
                    <colName>d.dat</colName>
                    <displayName>audit_date_1</displayName>
                    <displayWidth>10</displayWidth>
                    <displayWidthInPxls>nullpxpx</displayWidthInPxls>
                    <displayAlignment>Left</displayAlignment>
                    <orderSeq>1</orderSeq>
                    <visible>true</visible>
                    <calculated>true</calculated>
                    <colType>VARCHAR2</colType>
                    <groupBreak>false</groupBreak>
                    <colOnChart>LEGEND</colOnChart>
                    <chartSeq>1</chartSeq>
                    <chartSeries>false</chartSeries>
                    <isRangeAxisFilled>false</isRangeAxisFilled>
                    <drillinPoPUp>false</drillinPoPUp>
                    <dbColType>VARCHAR2</dbColType>
                    <enhancedPagination>false</enhancedPagination>
                </dataColumn>
                <dataColumn colId="app">
                    <tableId>du0</tableId>
                    <dbColName>'# of Minutes'</dbColName>
                    <colName>'# of Minutes'</colName>
                    <displayName>app</displayName>
                    <displayWidth>10</displayWidth>
                    <displayWidthInPxls>nullpxpx</displayWidthInPxls>
                    <displayAlignment>Left</displayAlignment>
                    <orderSeq>2</orderSeq>
                    <visible>true</visible>
                    <calculated>true</calculated>
                    <colType>VARCHAR2</colType>
                    <groupBreak>false</groupBreak>
                    <chartSeries>true</chartSeries>
                    <dbColType>VARCHAR2</dbColType>
                </dataColumn>
                <dataColumn colId="mins">
                    <tableId>du0</tableId>
                    <dbColName>coalesce(diff, null, 0)</dbColName>
                    <colName>coalesce(diff, null, 0)</colName>
                    <displayName>mins</displayName>
                    <displayWidth>10</displayWidth>
                    <displayWidthInPxls>nullpxpx</displayWidthInPxls>
                    <displayAlignment>Left</displayAlignment>
                    <orderSeq>3</orderSeq>
                    <visible>true</visible>
                    <calculated>true</calculated>
                    <colType>VARCHAR2</colType>
                    <groupBreak>false</groupBreak>
                    <colOnChart>0</colOnChart>
                    <chartSeq>1</chartSeq>
                    <chartColor></chartColor>
                    <chartLineType></chartLineType>
                    <chartSeries>false</chartSeries>
                    <dbColType>VARCHAR2</dbColType>
                    <chartGroup></chartGroup>
                    <yAxis></yAxis>
                </dataColumn>
            </dataColumnList>
        </dataSource>
    </dataSourceList>
    <reportInNewWindow>false</reportInNewWindow>
    <displayFolderTree>false</displayFolderTree>
    <maxRowsInExcelDownload>500</maxRowsInExcelDownload>
    <chartAdditionalOptions>
        <chartOrientation>vertical</chartOrientation>
        <hidechartLegend>N</hidechartLegend>
        <legendPosition>bottom</legendPosition>
        <labelAngle>down45</labelAngle>
        <animate>true</animate>
        <animateAnimatedChart>true</animateAnimatedChart>
        <stacked>true</stacked>
        <barControls>false</barControls>
        <xAxisDateType>false</xAxisDateType>
        <lessXaxisTickers>false</lessXaxisTickers>
        <timeAxis>true</timeAxis>
        <timeSeriesRender>line</timeSeriesRender>
        <multiSeries>false</multiSeries>
        <showXAxisLabel>false</showXAxisLabel>
        <addXAxisTickers>false</addXAxisTickers>
        <topMargin>30</topMargin>
        <bottomMargin>50</bottomMargin>
        <rightMargin>60</rightMargin>
        <leftMargin>100</leftMargin>
    </chartAdditionalOptions>
    <folderId>NULL</folderId>
    <drillURLInPoPUpPresent>false</drillURLInPoPUpPresent>
    <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>
    <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>
    <isDailyScheduleAllowed>N</isDailyScheduleAllowed>
    <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>
    <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>
    <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>
</customReport>
