<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customReport pageSize="200" reportType="Linear">
    <reportName>Application Usage Line Wid</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>false</public>
    <hideFormFieldAfterRun>false</hideFormFieldAfterRun>
    <createId>27</createId>
    <createDate>2017-01-28-05:00</createDate>
    <reportSQL>SELECT 
	l.date audit_date, 
	IF(CHAR_LENGTH(l.app_name) &gt;14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),'...'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name) app_name, 
	IFNULL(r.ct,0) ct 
from
(
	select a.Date, app_id, app_name
	from (
	    select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date
	    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
	) a, 
	(
		SELECT  
			app_id, app_name
		from
		(
			select @rn := @rn+1 AS rowId, app_id, app_name from 
				(
					select app_id, app_name, ct from 
					(
						select affected_record_id, count(*) ct
						from fn_audit_log l
						where audit_date &gt; date_add( curdate(), interval -30 day)
						and affected_record_id not in ( 1, -1)
						and activity_cd in ('tab_access', 'app_access')
						and user_id = [USER_ID]
						group by affected_record_id
					) a, fn_app f
					where a.affected_record_id = f.app_id
					order by ct desc 
				) b,
				(SELECT @rn := 0) t2
		) mm where rowId &lt;= 4
	)b
	where a.Date between date_add( curdate(), interval -30 day) and  curdate()
) l left outer join
(
	select app_name,  DATE(audit_date) audit_date_1 ,count(*) ct from fn_audit_log a, fn_app b
	where user_id = [USER_ID]
	and audit_date &gt; date_add( curdate(), interval -30 day)
	and activity_cd in ('tab_access', 'app_access')
	and a.affected_record_id = b.app_id
	and b.app_id &lt;&gt; 1
	and b.app_id in 
	(
		SELECT  
			app_id
		from
		(
			select @rn := @rn+1 AS rowId, app_id from 
				(
					select app_id, ct from 
					(
						select affected_record_id app_id, count(*) ct
						from fn_audit_log 
						where audit_date &gt; date_add( curdate(), interval -30 day)
						and affected_record_id not in ( 1, -1)
						and activity_cd in ('tab_access', 'app_access')
						and user_id = [USER_ID]
						group by affected_record_id
					) a
					order by ct desc 
				) b,
				(SELECT @rn := 0) t2
		) mm 
	)
	group by app_name,  DATE(audit_date)
) r
on l.Date = r.audit_date_1
and l.app_name = r.app_name</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>l.date</dbColName>
                    <colName>l.date</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_name">
                    <tableId>du0</tableId>
                    <dbColName>IF(CHAR_LENGTH(l.app_name) &gt;14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),'...'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</dbColName>
                    <colName>IF(CHAR_LENGTH(l.app_name) &gt;14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),'...'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</colName>
                    <displayName>app_name</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>
                    <colOnChart>0</colOnChart>
                    <chartSeq>2</chartSeq>
                    <chartColor></chartColor>
                    <chartLineType></chartLineType>
                    <chartSeries>true</chartSeries>
                    <isRangeAxisFilled>false</isRangeAxisFilled>
                    <drillinPoPUp>false</drillinPoPUp>
                    <dbColType>VARCHAR2</dbColType>
                    <chartGroup></chartGroup>
                    <yAxis></yAxis>
                    <enhancedPagination>false</enhancedPagination>
                </dataColumn>
                <dataColumn colId="ct">
                    <tableId>du0</tableId>
                    <dbColName>IFNULL(r.ct,0)</dbColName>
                    <colName>IFNULL(r.ct,0)</colName>
                    <displayName>ct</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>
                    <isRangeAxisFilled>false</isRangeAxisFilled>
                    <drillinPoPUp>false</drillinPoPUp>
                    <dbColType>VARCHAR2</dbColType>
                    <chartGroup></chartGroup>
                    <yAxis></yAxis>
                    <enhancedPagination>false</enhancedPagination>
                </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>
