<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="RH000014" 
	label="RH. Evolution mensuelle des [DICT.RH.ARRET_TRAVAIL#4]" 
	title="= SELECT.DATA_LABEL + ' par ' +  SELECT.GROUPBY_LABEL + ' de ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL " 
	database="iCTI" 
	swf="*CTI_view1" 
	globals="RH_globals.XML" 
	componentsFile="RH_components.XML" 
	softCode="iCTI_rh"
	dboptimizer="RH_dboptimizer.XML"
	helpDokuWIkiDir="rh:vues:arrets_de_travail" helpDokuWIkiFile="rh000014"  helpFile=""
>	
	
	<VIEWPROPERTIES componentName="PROPERTIES_ARRET"/>
	<VIEWPROPERTIES componentName="PROPERTIES_GROUPBY"/>
	<VIEWPROPERTIES>
		<PROPERTY name="TDATA">
			<value><![CDATA[[EVAL 
				switch ('[DATA]') {
					case 'NBARRETS':
						return 'count(DISTINCT CASE WHEN nb_arret = 1 THEN arret_travail_id ELSE null END)';
						break;
					case 'NBARRETSMOY':
						return 'base.cti_division(count(DISTINCT CASE WHEN nb_arret = 1 THEN arret_travail_id ELSE null END), COUNT(DISTINCT CASE WHEN nb_arret = 1 THEN salarie_id ELSE null END))';
						break;
					case 'DUREEMOY':
						return 'base.cti_division(base.cti_sum_distinct_on(DISTINCT ARRAY[(v_rh_view_1.arret_travail_id||v_rh_view_1.mois_activite_id)::numeric, v_rh_view_1.nb_jours_arret]), COUNT(DISTINCT CASE WHEN nb_arret = 1 THEN arret_travail_id ELSE null END))';
						break;
					case 'NBCONTRATS':
						return 'COUNT(DISTINCT CASE WHEN nb_arret = 1 THEN v_rh_view_1.contrat_id ELSE null END)';
						break;
					case 'NBARRETSDEBUT':
						return 'base.cti_sum_distinct_on(DISTINCT ARRAY[(v_rh_view_1.arret_travail_id)::numeric, v_rh_view_1.nb_debut_arret])';
						break;
					case 'NBARRETSREPRISE':
						return 'base.cti_sum_distinct_on(DISTINCT ARRAY[(v_rh_view_1.arret_travail_id)::numeric, v_rh_view_1.nb_reprise_apres_arret])';
						break;
					case 'NBJOURS':
						return 'SUM(v_rh_view_1.nb_jours_arret)';
						break;
					case 'NBSALARIES':
						return 'COUNT(DISTINCT CASE WHEN nb_arret = 1 THEN v_rh_view_1.salarie_id ELSE null END)';
						break;
					default:
						return 'base.cti_sum_distinct_on(DISTINCT ARRAY[(v_rh_view_1.arret_travail_id||v_rh_view_1.mois_activite_id)::numeric, v_rh_view_1.nb_jours_arret])';
				}
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="CDATA">
			<value><![CDATA[[EVAL 
				switch ('[DATA]') {
					case 'NBARRETS':
						return 'COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND nb_arret = 1 THEN v_rh_view_1.arret_travail_id ELSE null END)';
						break;
					case 'NBARRETSMOY':
						return 'base.cti_division(count(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND nb_arret = 1 THEN v_rh_view_1.arret_travail_id ELSE null END), COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND nb_arret = 1 THEN v_rh_view_1.salarie_id ELSE null END))';
						break;
					case 'DUREEMOY':
						return 'base.cti_division(base.cti_sum_distinct_on(DISTINCT ARRAY[(v_rh_view_1.arret_travail_id||v_rh_view_1.mois_activite_id)::numeric, CASE WHEN COLUMNCHECKSEQUENCE THEN nb_jours_arret ELSE 0 END]), COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND nb_arret = 1 THEN v_rh_view_1.arret_travail_id ELSE null END))';
						break;
					case 'NBCONTRATS':
						return 'COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND nb_arret = 1 THEN v_rh_view_1.contrat_id ELSE null END)';
						break;
					case 'NBARRETSDEBUT':
						return 'base.cti_sum_distinct_on(DISTINCT ARRAY[(v_rh_view_1.arret_travail_id)::numeric, CASE WHEN COLUMNCHECKSEQUENCE THEN v_rh_view_1.nb_debut_arret ELSE 0 END])';
						break;
					case 'NBARRETSREPRISE':
						return 'base.cti_sum_distinct_on(DISTINCT ARRAY[(v_rh_view_1.arret_travail_id)::numeric, CASE WHEN COLUMNCHECKSEQUENCE THEN v_rh_view_1.nb_reprise_apres_arret ELSE 0 END])';
						break;
					case 'NBJOURS':
						return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_jours_arret ELSE 0 END)';
						break;
					case 'NBSALARIES':
						return 'COUNT(DISTINCT CASE WHEN COLUMNCHECKSEQUENCE AND nb_arret = 1 THEN v_rh_view_1.salarie_id ELSE null END)';
						break;
					default:
						return 'SUM(CASE WHEN COLUMNCHECKSEQUENCE THEN nb_jours_arret ELSE 0 END)';
				}
			EVAL]]]></value>
		</PROPERTY>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse" displayText="">
		<GROUP label="Période">
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
			<FIELD name="PERIODE" label="" UI="combo" tree="true" width="200" default="2010-01-01" globalListProvider="PERIODE_DEBUT">
			</FIELD>
			<FIELD name="TOPERIODE" label="au" UI="combo" tree="true" width="200" default="2010-01-31" globalListProvider="PERIODE_FIN">
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="PERIODICITE" label="Périodicité" width="200" UI="combo" default="MONTH">
				<OPTION label="Mensuelle" data="MONTH" />
				<OPTION label="Trimestrielle" data="QUARTER" />
				<OPTION label="Annuelle" data="YEAR" />
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="DATA" label="Donnée" UI="combo" default="NBARRETS">
				<OPTION label="Nombre d'arrêts de travail" data="NBARRETS" data2="#,0"/>
				<OPTION label="Nombre d'arrêts de travail moyen" data="NBARRETSMOY" data2="#,0"/>
				<OPTION label="Nombre de jours d'arrêt de travail" data="NBJOURS" data2="#,0"/>
				<OPTION label="Durée moyenne des arrêts de travail" data="DUREEMOY" data2="#,0"/>
				<OPTION label="Nombre de [DICT.RH.SALARIE#4] avec arrêt de travail" data="NBSALARIES" data2="#"/>
				<OPTION label="Nombre de nouveaux arrêts de travail" data="NBARRETSDEBUT" data2="#"/>
				<OPTION label="Nombre reprise après arrêt de travail" data="NBARRETSREPRISE" data2="#"/>
				<OPTION label="Nombre de contrats avec arrêt de travail" data="NBCONTRATS" data2="#"/>
			</FIELD>
		</GROUP>
		<GROUP label="Regroupement">
			<FIELD name="GROUPBY" label="" UI="combo" width="200" default="SAL" tree="true" >
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="[DICT.RH.ARRET_TRAVAIL_COURT#1]" data="MOA" treeLevel="1" globalListProvider="ARRET_GROUPBY"/>
				<OPTION label="[DICT.RH.SALARIE#1]" data="SAL" treeLevel="1" globalListProvider="SALARIE_GROUPBY"/>
				<OPTION label="[DICT.RH.CONTRAT#1]" data="CNT" treeLevel="1" globalListProvider="CONTRAT_GROUPBY"/>
				<OPTION label="Temporel" data="MOIACT" treeLevel="1" globalListProvider="TEMPOREL_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" width="100" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.GROUPBY_2 != '-1' ">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_2" label="" width="200" UI="combo" default="-1" tree="true" >
				<OPTION label="Pas de second niveau" data="-1"/>
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="[DICT.RH.ARRET_TRAVAIL_COURT#1]" data="MOA" treeLevel="1" globalListProvider="ARRET_GROUPBY"/>
				<OPTION label="[DICT.RH.SALARIE#1]" data="SAL" treeLevel="1" globalListProvider="SALARIE_GROUPBY"/>
				<OPTION label="[DICT.RH.CONTRAT#1]" data="CNT" treeLevel="1" globalListProvider="CONTRAT_GROUPBY"/>
				<OPTION label="Temporel" data="MOIACT" treeLevel="1" globalListProvider="TEMPOREL_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_3" label="" width="200" UI="combo" default="-1" tree="true" >
				<OPTION label="Pas de troisième niveau" data="-1"/>
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="[DICT.RH.ARRET_TRAVAIL_COURT#1]" data="MOA" treeLevel="1" globalListProvider="ARRET_GROUPBY"/>
				<OPTION label="[DICT.RH.SALARIE#1]" data="SAL" treeLevel="1" globalListProvider="SALARIE_GROUPBY"/>
				<OPTION label="[DICT.RH.CONTRAT#1]" data="CNT" treeLevel="1" globalListProvider="CONTRAT_GROUPBY"/>
				<OPTION label="Temporel" data="MOIACT" treeLevel="1" globalListProvider="TEMPOREL_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_SALCNT_SOUSSELECTIONS"/>
	<SELECTIONS componentName="FILTRES_ARRETS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SALARIES_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_REFERENTIEL_SAE_SELECTIONS"/>
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_AT_X" optimizer2="V_ALL_X">
				<select><![CDATA[		

					CTISELECT_TREE
						GROUPBY1{[VIEW.GROUPBY_OID_FIELD],, [VIEW.GROUPBY_COD_FIELD],, [VIEW.GROUPBY_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_OID_FIELD],, [VIEW.GROUPBY_2_COD_FIELD],, [VIEW.GROUPBY_2_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_OID_FIELD],, [VIEW.GROUPBY_3_COD_FIELD],, [VIEW.GROUPBY_3_TXT_FIELD]}
						COLUMNBY[PERIODICITE]{v_rh_view_1.date_fin_activite,, '[PERIODE]' ,, '[TOPERIODE]' ,, 12,, [VIEW.COLUMN_OPTION]}
						SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
						OPTIONS{NOTZERO=1}
						INDICATORS{[VIEW.TDATA],}	
						INDICATORS_COLUMNS{[VIEW.CDATA], }
					FROM #V_AT_X##V_ALL_X#
					WHERE v_rh_view_1.date_fin_activite BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.SALARIES_SELECT]
						[VIEW.CONTRATS_SELECT]
						[VIEW.REFERENTIEL_SAE_SELECT]
						[VIEW.ARRETS_SELECT]
						
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="N"/>
					<FIELD name="N0"/>
					<FIELD name="N1"/>
					<FIELD name="N2"/>
					<FIELD name="N3"/>
					<FIELD name="N4"/>
					<FIELD name="N5"/>
					<FIELD name="N6"/>
					<FIELD name="N7"/>
					<FIELD name="N8"/>
					<FIELD name="N9"/>
					<FIELD name="N10"/>
					<FIELD name="N11"/>
					<FIELD name="N12"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Justificatif des [DICT.RH.ARRET_TRAVAIL#4]" shortLabel="Justificatif des [DICT.RH.ARRET_TRAVAIL#4]" view="RH000010.XML" componentName="RH_VIEWLINK" >
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['GROUPBY_2'] = 'SAL'
						return 'OK';
					]]></value>
				</ARGS>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Evolution mensuelle" label="Evolution mensuelle" multiTab="true">
			<CHART title="Evolution (Total)" type="lineChart" serieIsCategory="true" fromTotal="true">
				<CATEGORY field="TXT" type="Char"/>
				<SERIE field="N1" displayName="VIEW.COLH1" displayNameCalc="true" visibleCondition="VIEW.COLH1 != null"/>
				<SERIE field="N2" displayName="VIEW.COLH2" displayNameCalc="true" visibleCondition="VIEW.COLH2 != null"/>
				<SERIE field="N3" displayName="VIEW.COLH3" displayNameCalc="true" visibleCondition="VIEW.COLH3 != null"/>
				<SERIE field="N4" displayName="VIEW.COLH4" displayNameCalc="true" visibleCondition="VIEW.COLH4 != null"/>
				<SERIE field="N5" displayName="VIEW.COLH5" displayNameCalc="true" visibleCondition="VIEW.COLH5 != null"/>
				<SERIE field="N6" displayName="VIEW.COLH6" displayNameCalc="true" visibleCondition="VIEW.COLH6 != null"/>
				<SERIE field="N7" displayName="VIEW.COLH7" displayNameCalc="true" visibleCondition="VIEW.COLH7 != null"/>
				<SERIE field="N8" displayName="VIEW.COLH8" displayNameCalc="true" visibleCondition="VIEW.COLH8 != null"/>
				<SERIE field="N9" displayName="VIEW.COLH9" displayNameCalc="true" visibleCondition="VIEW.COLH9 != null"/>
				<SERIE field="N10" displayName="VIEW.COLH10" displayNameCalc="true" visibleCondition="VIEW.COLH10 != null"/>
				<SERIE field="N11" displayName="VIEW.COLH11" displayNameCalc="true" visibleCondition="VIEW.COLH11 != null"/>
				<SERIE field="N12" displayName="VIEW.COLH12" displayNameCalc="true" visibleCondition="VIEW.COLH12 != null"/>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="36" variableRowHeight="true" sortable="= SELECT.GROUPBY_3 == '-1' &amp;&amp; (SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB')" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid"/>
				<COLUMN dataField="COD" width="90" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="50" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="*ROW"/>
				<COLUMN dataField="N" width="80" visibleCondition="SELECT.PERIODICITE != 'YEAR'" type="Number" outputFormat="= SELECT.DATA2" headerText="Total" textAlign="right" totalFunction="sum" otherFunction="sum"/>
				<COLUMN dataField="N_P" type="Number" headerText="% / Total" width="70" visibleCondition="SELECT.PERIODICITE != 'YEAR'" outputFormat="0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.N / TOTALROW.N * 100"/>
				</COLUMN>
				<COLUMN dataField="N0"  width="70" visibleCondition="VIEW.COLH0 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" headerText="&lt;&lt;" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N1"  width="70" visibleCondition="VIEW.COLH1 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH1" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N2"  width="70" visibleCondition="VIEW.COLH2 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH2" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N3"  width="70" visibleCondition="VIEW.COLH3 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH3" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N4"  width="70" visibleCondition="VIEW.COLH4 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH4" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N5"  width="70" visibleCondition="VIEW.COLH5 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH5" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N6"  width="70" visibleCondition="VIEW.COLH6 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH6" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N7"  width="70" visibleCondition="VIEW.COLH7 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH7" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N8"  width="70" visibleCondition="VIEW.COLH8 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH8" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N9"  width="70" visibleCondition="VIEW.COLH9 != null"  type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH9" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N10" width="70" visibleCondition="VIEW.COLH10 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH10" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N11" width="70" visibleCondition="VIEW.COLH11 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH11" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
				<COLUMN dataField="N12" width="70" visibleCondition="VIEW.COLH12 != null" type="Number" outputFormat="= SELECT.DATA2" fixed="false" selectable="true" headerText="VIEW.COLH12" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum"/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
