<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000169" 
    label="Activité. Comparaison mensuelle occupation" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_activite" 
	globals="ACTI_globals.XML" 
	componentsFile="ACTI_components.XML" 
	dboptimizer="ACTI_dboptimizer.XML"
	helpFile="iCTI_ACTI_ACTI000169.HTML"
    helpDokuWIkiDir="activite:occupation_sejours" 
    helpDokuWIkiFile="acti000169" 
>
	
	<title><![CDATA[=	
		
		var group_by_label = '';
		if (SELECT.GROUPBY != '-1') {
			group_by_label = ' par ' + SELECT.GROUPBY_LABEL;
		}
		if (SELECT.GROUPBY_2 != '-1') {
			group_by_label = group_by_label + ' et ' + SELECT.GROUPBY_2_LABEL;
		}
		
		var date_label = '(' + 'N-1 : '+ VIEW.PERIODE_D_LABEL + ' à ' +  VIEW.TOPERIODE_D_LABEL + ' vs ' + ' N : '+ SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')';
		
		return 'Comparatif période et dernier mois d\'occupation ' + group_by_label + ' ' + date_label;
		
	]]></title>
	<VIEWPROPERTIES componentName="PROPERTIES_OCCUPATION"/>
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
		
		<PROPERTY name="DATA1F">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA1]', 0, "date BETWEEN '[PERIODE]' AND '[TOPERIODE]'", "[PERIODE]", "[TOPERIODE]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA1D">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA1]', 0, "date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'", "[VIEW.PERIODE_D]", "[VIEW.TOPERIODE_D]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA2F">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA2]', 0, "date BETWEEN '[PERIODE]' AND '[TOPERIODE]'", "[PERIODE]", "[TOPERIODE]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA2D">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA2]', 0, "date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'", "[VIEW.PERIODE_D]", "[VIEW.TOPERIODE_D]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA3F">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA3]', 0, "date BETWEEN '[PERIODE]' AND '[TOPERIODE]'", "[PERIODE]", "[TOPERIODE]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA3D">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA3]', 0, "date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'", "[VIEW.PERIODE_D]", "[VIEW.TOPERIODE_D]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA1MF">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA1]', 0, "date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]'", "[PERIODE]", "[TOPERIODE]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA1MD">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA1]', 0, "date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'", "[VIEW.PERIODE_D]", "[VIEW.TOPERIODE_D]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA2MF">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA2]', 0, "date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]'", "[PERIODE]", "[TOPERIODE]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA2MD">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA2]', 0, "date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'", "[VIEW.PERIODE_D]", "[VIEW.TOPERIODE_D]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA3MF">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA3]', 0, "date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]'", "[PERIODE]", "[TOPERIODE]"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA3MD">
			<value><![CDATA[[EVAL return ACTI_MOUVEMENT_data('[DATA3]', 0, "date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'", "[VIEW.PERIODE_D]", "[VIEW.TOPERIODE_D]"); EVAL]]]></value>
		</PROPERTY>
        <PROPERTY name="COMPAREPERIODETXT">
			<value><![CDATA[[EVAL 
					
                $TYPE_COMPARAISON_TXT = '[TYPE_COMPARAISON]';
                if($TYPE_COMPARAISON_TXT == '2'){
                    return 'N-1'; 
                } else {
                        return 'N-2';
                }
                
					
			EVAL]]]></value>
		</PROPERTY>		
		<PROPERTY name="ORDERBY">
			<value><![CDATA[
						[EVAL 
							if (substr('[GROUBY]', 0, 6) != 'AGECLS' && '[GROUPBY]' != 'AGE' && substr('[GROUBY_2]', 0, 6) != 'AGECLS' && '[GROUPBY_2]' != 'AGE') {
								return " ORDERBY{indicateurs[2],, DESC} ";
							}
							else  {
								return "";
							}
							
						EVAL]
					]]></value>
		</PROPERTY>
		
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP>
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
            <FIELD name="PERIODE" label="Période" UI="combo" tree="true" width="150" default="2009-01-01" globalListProvider="DATE_DEBUT" >
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2009-01-31" globalListProvider="DATE_FIN" >
			</FIELD>
		</GROUP>
		<GROUP label="Comparer avec">
			<FIELD name="TYPE_COMPARAISON" label="" UI="combo" default="2" width="200">
				<OPTION label="Année précédente" data="2" />
				<OPTION label="Saisie période" data="S" />
			</FIELD>
			<FIELD name="PERIODE_D" label="De" UI="combo" tree="true" width="150" default="2008-01-01" globalListProvider="DATE_DEBUT" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="150" default="2008-01-31" globalListProvider="DATE_FIN" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="COMPARE_OPTION" width="200" label="Option" UI="combo" default="DERNIERMOIS" visible="false" >
				<OPTION label="" data="-1"/>
				<OPTION label="Comparaison du dernier mois" data="DERNIERMOIS"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="PRESENTATION" label="Présentation" UI="combo" default="1" width="300">
				<OPTION label="Automatique" data="1" />
				<OPTION label="Ecart en nombre" data="2" />
				<OPTION label="Ecart en %" data="3" />
				<OPTION label="Ecart en nombre et %" data="4" />
				<OPTION label="Aucun" data="5" />
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY" label="Regroupement" UI="combo" width="300" default="SER" tree="true">
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_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>
			<FIELD name="GROUPBY_2" label="" UI="combo" width="300" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" treeLevel="1"/>
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY_3" label="" UI="combo" width="300" default="-1" tree="true">
				<OPTION label="Pas de troisième niveau" data="-1" treeLevel="1"/>
				<OPTION label="OCCUPATION_GROUPBY" data="" globalListProvider="OCCUPATION_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="DATA1" label="Données" UI="combo" width="400" default="NED" default2="0" tree="true">
				<OPTION label="Options" data="" globalListProvider="DATA_OCCUPATION" />
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="DATA2" label="" UI="combo" width="400" default="-1" default2="0" tree="true">
				<OPTION label="" data="-1"/>
				<OPTION label="Options" data="" globalListProvider="DATA_OCCUPATION" />
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="DATA3" label="" UI="combo" width="400" default="-1" default2="0" tree="true">
				<OPTION label="" data="-1"/>
				<OPTION label="Options" data="" globalListProvider="DATA_OCCUPATION" />
			</FIELD>
		</GROUP>
	</SELECTIONS>
	
	<SELECTIONS componentName="DAYS_SELECTIONS" />
	
	<SELECTIONS label="Modes de calcul" displayText="= var display:String = '';
						display = display + 'Modes de calcul : #B#' + SELECT.QPLACES_LABEL + '. ' + VIEW.OPTADM_DAYOUT  + '#/B#';
						return display;
						">
		<GROUP label="Modes">
			<FIELD name="QPLACES" label="" width="200" UI="combo" default="OUV">
				<OPTION data="OUV" label="Lits et box ouverts"/>
				<OPTION data="THEO" label="Lits et box théoriques"/>
			</FIELD>
			<FIELD name="QJMUT" label="" UI="combo" default="f">
				<OPTION data="d" label="Si mutation, journée affectée à la premiere localisation"/>
				<OPTION data="f" label="Si mutation, journée affectée à la dernière localisation"/>
				<OPTION data="12" label="Si mutation, journée affectée à la localisation occupée à 12h"/>
				<OPTION data="prorata" label="Si mutation, journée affectée au prorata du temps passé"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_OCCUPATION_SOUSSELECTIONS"/>
	<SELECTIONS componentName="FILTRES_MOUVEMENTS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SEJOURS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PATIENTS_SELECTIONS" />
	<SELECTIONS componentName="FILTRES_PASSAGES_SELECTIONS" />

	<QUERIES>
		<QUERY label="">
			<SQL>
				<select><![CDATA[		
					
					
					CTIPREPAR_TREE
						WORKTABLE{acti000056_places}
						GROUPBY1{[VIEW.GROUPBY_PLACES_OID_FIELD],, [VIEW.GROUPBY_PLACES_COD_FIELD],, [VIEW.GROUPBY_PLACES_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_PLACES_OID_FIELD],, [VIEW.GROUPBY_2_PLACES_COD_FIELD],, [VIEW.GROUPBY_2_PLACES_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_PLACES_OID_FIELD],, [VIEW.GROUPBY_3_PLACES_COD_FIELD],, [VIEW.GROUPBY_3_PLACES_TXT_FIELD]}
					INDICATORS{
						SUM(CASE WHEN date = '[TOPERIODE]' THEN v_places_1.nb_lits_theoriques ELSE 0 END),,
						
						SUM(CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' THEN v_places_1.[VIEW.PLACES_FIELD] ELSE NULL END),,
						SUM(CASE WHEN date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' THEN v_places_1.[VIEW.PLACES_FIELD] ELSE NULL END),,
						SUM(CASE WHEN date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' THEN v_places_1.[VIEW.PLACES_FIELD] ELSE NULL END),,
						SUM(CASE WHEN date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' THEN v_places_1.[VIEW.PLACES_FIELD] ELSE NULL END),,
					
						COUNT(DISTINCT CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' THEN date ELSE NULL END),,
										
						COUNT(DISTINCT CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_hospitalises = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_hospitalises = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_hospitalises = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_hospitalises = '1' THEN date ELSE NULL END),,
					
						COUNT(DISTINCT CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_externes = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_externes = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_externes = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_externes = '1' THEN date ELSE NULL END),,
					
						COUNT(DISTINCT CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_ambulatoires = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_ambulatoires = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_ambulatoires = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_ambulatoires = '1' THEN date ELSE NULL END),,
											
						COUNT(DISTINCT CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_seances = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_seances = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND v_places_1.est_ouvert = '1' AND heberge_seances = '1' THEN date ELSE NULL END),,
						COUNT(DISTINCT CASE WHEN date BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND v_places_1.est_ouvert = '1' AND heberge_seances = '1' THEN date ELSE NULL END)
					
					}
					
					FROM activite.v_places_1
					WHERE 
						(date BETWEEN '[PERIODE]' AND '[TOPERIODE]' or date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]')
						[VIEW.ETAGE_PLACES_SELECT]

				]]></select>
			</SQL>
			
			<SQL optimizer="V_SEJOURS_X" optimizer2="V_MOUVEMENTS_SEJOUR_X">
				<select><![CDATA[		
					
						
					CTISELECT_TREE
						WORKTABLE{acti000056}
						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]}
						SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}

						INDICATORS{
							0,,
							COALESCE([VIEW.DATA1F],0),,
							COALESCE([VIEW.DATA1D],0),,
							0,,
							0,,
							COALESCE([VIEW.DATA2F],0),,
							COALESCE([VIEW.DATA2D],0),,
							0,,
							0,,
							COALESCE([VIEW.DATA3F],0),,
							COALESCE([VIEW.DATA3D],0),,
							0,,
							0,,
							COALESCE([VIEW.DATA1MF],0),,
							COALESCE([VIEW.DATA1MD],0),,
							0,,
							0,,
							COALESCE([VIEW.DATA2MF],0),,
							COALESCE([VIEW.DATA2MD],0),,
							0,,
							0,,
							COALESCE([VIEW.DATA3MF],0),,
							COALESCE([VIEW.DATA3MD],0),,
							0,,
							0
						}	
						ORDERBY{indicateurs[2],, DESC}

					FROM #V_SEJOURS_X#
					JOIN #V_MOUVEMENTS_SEJOUR_X# ON v_mouvements_sejour_2.no_sejour = v_sejours_1.no_sejour 
					WHERE 
						(date BETWEEN '[PERIODE]' AND '[TOPERIODE]' or date BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]')
						[VIEW.SEJOURS_SELECT] [VIEW.PATIENTS_SELECT]
						[VIEW.MOUVEMENTS_SELECT] AND est_mouvement_previsionnel <> '1'
						[VIEW.JOURS_SELECT]
						[VIEW.PASSAGES_SELECT]
						AND v_sejours_1.type_sejour <> '9'
						
					AFTER{
					
						UPDATE acti000056 SET 
							indicateurs[1] = acti000056_places.indicateurs[1]
							[EVAL 
							if ('[DATA1]' == 'TAU') {
								return "
								,
								indicateurs[2] = base.cti_division(acti000056.indicateurs[2] , acti000056_places.indicateurs[2]) * 100,
								indicateurs[3] = base.cti_division(acti000056.indicateurs[3] , acti000056_places.indicateurs[3]) * 100,
								indicateurs[14] = base.cti_division(acti000056.indicateurs[14] , acti000056_places.indicateurs[4]) * 100,
								indicateurs[15] = base.cti_division(acti000056.indicateurs[15] , acti000056_places.indicateurs[5]) * 100
								";
							}
							if ('[DATA1]' == 'NJNM') {
								return "
								,
								indicateurs[2] = base.cti_division(acti000056.indicateurs[2] , acti000056_places.indicateurs[10]) ,
								indicateurs[3] = base.cti_division(acti000056.indicateurs[3] , acti000056_places.indicateurs[11]) ,
								indicateurs[14] = base.cti_division(acti000056.indicateurs[14] , acti000056_places.indicateurs[12]) ,
								indicateurs[15] = base.cti_division(acti000056.indicateurs[15] , acti000056_places.indicateurs[13])
								";
							}
							if ('[DATA1]' == 'NEXM') {
								return "
								,
								indicateurs[2] = base.cti_division(acti000056.indicateurs[2] , acti000056_places.indicateurs[14]) ,
								indicateurs[3] = base.cti_division(acti000056.indicateurs[3] , acti000056_places.indicateurs[15]) ,
								indicateurs[14] = base.cti_division(acti000056.indicateurs[14] , acti000056_places.indicateurs[16]) ,
								indicateurs[15] = base.cti_division(acti000056.indicateurs[15] , acti000056_places.indicateurs[17])
								";
							}
							if ('[DATA1]' == 'NAMM') {
								return "
								,
								indicateurs[2] = base.cti_division(acti000056.indicateurs[2] , acti000056_places.indicateurs[18]) ,
								indicateurs[3] = base.cti_division(acti000056.indicateurs[3] , acti000056_places.indicateurs[19]) ,
								indicateurs[14] = base.cti_division(acti000056.indicateurs[14] , acti000056_places.indicateurs[20]) ,
								indicateurs[15] = base.cti_division(acti000056.indicateurs[15] , acti000056_places.indicateurs[21])
								";
							}
							if ('[DATA1]' == 'NJNXAM') {
								return "
								,
								indicateurs[2] = base.cti_division(acti000056.indicateurs[2] , acti000056_places.indicateurs[6]) ,
								indicateurs[3] = base.cti_division(acti000056.indicateurs[3] , acti000056_places.indicateurs[7]) ,
								indicateurs[14] = base.cti_division(acti000056.indicateurs[14] , acti000056_places.indicateurs[8]) ,
								indicateurs[15] = base.cti_division(acti000056.indicateurs[15] , acti000056_places.indicateurs[9])
								";
							}
							
							if ('[DATA1]' == 'NJO') {
								return "
								,
								indicateurs[2] = acti000056_places.indicateurs[6] ,
								indicateurs[3] = acti000056_places.indicateurs[7] ,
								indicateurs[14] = acti000056_places.indicateurs[8] ,
								indicateurs[15] = acti000056_places.indicateurs[9]
								";
							}
							EVAL]
							
							[EVAL 
							if ('[DATA2]' == 'TAU') {
								return "
								,
								indicateurs[6] = base.cti_division(acti000056.indicateurs[6] , acti000056_places.indicateurs[2]) * 100,
								indicateurs[7] = base.cti_division(acti000056.indicateurs[7] , acti000056_places.indicateurs[3]) * 100,
								indicateurs[18] = base.cti_division(acti000056.indicateurs[18] , acti000056_places.indicateurs[4]) * 100,
								indicateurs[19] = base.cti_division(acti000056.indicateurs[19] , acti000056_places.indicateurs[5]) * 100
								";
							}
							if ('[DATA2]' == 'NJNM') {
								return "
								,
								indicateurs[6] = base.cti_division(acti000056.indicateurs[6] , acti000056_places.indicateurs[10]) ,
								indicateurs[7] = base.cti_division(acti000056.indicateurs[7] , acti000056_places.indicateurs[11]) ,
								indicateurs[18] = base.cti_division(acti000056.indicateurs[18] , acti000056_places.indicateurs[12]) ,
								indicateurs[19] = base.cti_division(acti000056.indicateurs[19] , acti000056_places.indicateurs[13])
								";
							}
							if ('[DATA2]' == 'NEXM') {
								return "
								,
								indicateurs[6] = base.cti_division(acti000056.indicateurs[6] , acti000056_places.indicateurs[14]) ,
								indicateurs[7] = base.cti_division(acti000056.indicateurs[7] , acti000056_places.indicateurs[15]) ,
								indicateurs[18] = base.cti_division(acti000056.indicateurs[18] , acti000056_places.indicateurs[16]) ,
								indicateurs[19] = base.cti_division(acti000056.indicateurs[19] , acti000056_places.indicateurs[17])
								";
							}
							if ('[DATA2]' == 'NAMM') {
								return "
								,
								indicateurs[6] = base.cti_division(acti000056.indicateurs[6] , acti000056_places.indicateurs[18]) ,
								indicateurs[7] = base.cti_division(acti000056.indicateurs[7] , acti000056_places.indicateurs[19]) ,
								indicateurs[18] = base.cti_division(acti000056.indicateurs[18] , acti000056_places.indicateurs[20]) ,
								indicateurs[19] = base.cti_division(acti000056.indicateurs[19] , acti000056_places.indicateurs[21])
								";
							}
							if ('[DATA2]' == 'NJNXAM') {
								return "
								,
								indicateurs[6] = base.cti_division(acti000056.indicateurs[6] , acti000056_places.indicateurs[6]) ,
								indicateurs[7] = base.cti_division(acti000056.indicateurs[7] , acti000056_places.indicateurs[7]) ,
								indicateurs[18] = base.cti_division(acti000056.indicateurs[18] , acti000056_places.indicateurs[8]) ,
								indicateurs[19] = base.cti_division(acti000056.indicateurs[19] , acti000056_places.indicateurs[9])
								";
							}
							
							if ('[DATA2]' == 'NJO') {
								return "
								,
								indicateurs[6] = acti000056_places.indicateurs[6] ,
								indicateurs[7] = acti000056_places.indicateurs[7] ,
								indicateurs[18] = acti000056_places.indicateurs[8] ,
								indicateurs[19] = acti000056_places.indicateurs[9]
								";
							}
							EVAL]
							
							[EVAL 
							if ('[DATA3]' == 'TAU') {
								return "
								,
								indicateurs[10] = base.cti_division(acti000056.indicateurs[10] , acti000056_places.indicateurs[2]) * 100,
								indicateurs[11] = base.cti_division(acti000056.indicateurs[11] , acti000056_places.indicateurs[3]) * 100,
								indicateurs[22] = base.cti_division(acti000056.indicateurs[22] , acti000056_places.indicateurs[4]) * 100,
								indicateurs[23] = base.cti_division(acti000056.indicateurs[23] , acti000056_places.indicateurs[5]) * 100
								";
							}
							if ('[DATA3]' == 'NJNM') {
								return "
								,
								indicateurs[10] = base.cti_division(acti000056.indicateurs[10] , acti000056_places.indicateurs[10]) ,
								indicateurs[11] = base.cti_division(acti000056.indicateurs[11] , acti000056_places.indicateurs[11]) ,
								indicateurs[22] = base.cti_division(acti000056.indicateurs[22] , acti000056_places.indicateurs[12]) ,
								indicateurs[23) = base.cti_division(acti000056.indicateurs[23] , acti000056_places.indicateurs[13])
								";
							}
							if ('[DATA3]' == 'NEXM') {
								return "
								,
								indicateurs[10] = base.cti_division(acti000056.indicateurs[10] , acti000056_places.indicateurs[14]) ,
								indicateurs[11] = base.cti_division(acti000056.indicateurs[11] , acti000056_places.indicateurs[15]) ,
								indicateurs[22] = base.cti_division(acti000056.indicateurs[22] , acti000056_places.indicateurs[16]) ,
								indicateurs[23] = base.cti_division(acti000056.indicateurs[23] , acti000056_places.indicateurs[17])
								";
							}
							if ('[DATA3]' == 'NAMM') {
								return "
								,
								indicateurs[10] = base.cti_division(acti000056.indicateurs[10] , acti000056_places.indicateurs[18]) ,
								indicateurs[11] = base.cti_division(acti000056.indicateurs[11] , acti000056_places.indicateurs[19]) ,
								indicateurs[22] = base.cti_division(acti000056.indicateurs[22] , acti000056_places.indicateurs[20]) ,
								indicateurs[23] = base.cti_division(acti000056.indicateurs[23] , acti000056_places.indicateurs[21])
								";
							}
							if ('[DATA3]' == 'NJNXAM') {
								return "
								,
								indicateurs[10] = base.cti_division(acti000056.indicateurs[10] , acti000056_places.indicateurs[6]) ,
								indicateurs[11] = base.cti_division(acti000056.indicateurs[11] , acti000056_places.indicateurs[7]) ,
								indicateurs[22] = base.cti_division(acti000056.indicateurs[22] , acti000056_places.indicateurs[8]) ,
								indicateurs[23] = base.cti_division(acti000056.indicateurs[23] , acti000056_places.indicateurs[9])
								";
							}
							
							if ('[DATA3]' == 'NJO') {
								return "
								,
								indicateurs[10] = acti000056_places.indicateurs[6] ,
								indicateurs[11] = acti000056_places.indicateurs[7] ,
								indicateurs[22] = acti000056_places.indicateurs[8] ,
								indicateurs[23] = acti000056_places.indicateurs[9]
								";
							}
							
							EVAL]
						FROM acti000056_places
						WHERE 
							(acti000056_places.oidt = acti000056.oidt OR acti000056_places.oidt = -111) AND
							(acti000056_places.oid1 = acti000056.oid1 OR acti000056_places.oid1 = -111) AND
							(acti000056_places.oid2 = acti000056.oid2 OR acti000056_places.oid2 = -111) AND
							(acti000056_places.oid3 = acti000056.oid3 OR acti000056_places.oid3 = -111)
							
						.,
						
						UPDATE acti000056 SET 
							indicateurs[4] = indicateurs[2] - indicateurs[3],
							indicateurs[5] = base.cti_division(indicateurs[2] - indicateurs[3] , indicateurs[3]) * 100,
							indicateurs[8] = indicateurs[6] - indicateurs[7],
							indicateurs[9] = base.cti_division(indicateurs[6] - indicateurs[7] , indicateurs[7]) * 100,
							indicateurs[12] = indicateurs[10] - indicateurs[11],
							indicateurs[13] = base.cti_division(indicateurs[10] - indicateurs[11] , indicateurs[11]) * 100,
							indicateurs[16] = indicateurs[14] - indicateurs[15],
							indicateurs[17] = base.cti_division(indicateurs[14] - indicateurs[15] , indicateurs[15]) * 100,
							indicateurs[20] = indicateurs[18] - indicateurs[19],
							indicateurs[21] = base.cti_division(indicateurs[18] - indicateurs[19] , indicateurs[19]) * 100,
							indicateurs[24] = indicateurs[22] - indicateurs[23],
							indicateurs[25] = base.cti_division(indicateurs[22] - indicateurs[23] , indicateurs[23]) * 100
					}
					
					


				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="SORT"/>
					<FIELD name="LIT"/>
					<FIELD name="F1"/>
					<FIELD name="D1"/>
					<FIELD name="E1"/>
					<FIELD name="P1"/>
					<FIELD name="F2"/>
					<FIELD name="D2"/>
					<FIELD name="E2"/>
					<FIELD name="P2"/>
					<FIELD name="F3"/>
					<FIELD name="D3"/>
					<FIELD name="E3"/>
					<FIELD name="P3"/>
					
					<FIELD name="MF1"/>
					<FIELD name="MD1"/>
					<FIELD name="ME1"/>
					<FIELD name="MP1"/>
					<FIELD name="MF2"/>
					<FIELD name="MD2"/>
					<FIELD name="ME2"/>
					<FIELD name="MP2"/>
					<FIELD name="MF3"/>
					<FIELD name="MD3"/>
					<FIELD name="ME3"/>
					<FIELD name="MP3"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false"> 
		
			<SQL>
				<select><![CDATA[	
					SELECT 'PERIODE_D' , CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[PERIODE_D]' END::text
					UNION
					SELECT 'TOPERIODE_D' , CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[TOPERIODE_D]' END::text
					UNION
					SELECT 'PERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[PERIODE_D]' END = p_calendrier_mois.date_debut THEN p_calendrier_mois.texte  ELSE p_calendrier.texte_court END
					FROM base.p_calendrier
						JOIN base.p_calendrier_mois ON p_calendrier.mois = p_calendrier_mois.mois
					WHERE date = CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[PERIODE_D]' END
					UNION
					SELECT 'TOPERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[TOPERIODE_D]' END = p_calendrier_mois.date_fin THEN p_calendrier_mois.texte ELSE p_calendrier.texte_court END
					FROM base.p_calendrier
						JOIN base.p_calendrier_mois ON p_calendrier.mois = p_calendrier_mois.mois
					WHERE date = CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[TOPERIODE_D]' END
				]]></select>
				<FIELDS>
					<FIELD name="name" />
					<FIELD name="value" />
				</FIELDS>
			</SQL>

		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select><![CDATA[ 
					
						SELECT 'ANA_CROI_PERIODE', to_char(greatest(	date_trunc('year', '[TOPERIODE]'::date) - INTERVAL  '3 year', 
														(SELECT date_trunc('year', min(date_comptable)) FROM activite.p_chiffrier_comptable)
													)::date, 'YYYY-MM-DD')
					UNION ALL
						SELECT 'ANA_CROI_TOPERIODE', 	to_char(
									least(	date_trunc('year', '[TOPERIODE]'::date) - interval '1 day' + interval '1 year',
												'[TOPERIODE]'::date)
									, 'YYYY-MM-DD')
					UNION ALL
						SELECT 'COMP_PERIODE', to_char(
									greatest(	date_trunc('year', '[TOPERIODE]'::date),
												date_trunc('month', '[PERIODE]'::date))
									, 'YYYY-MM-DD')
					UNION ALL
						SELECT 'COMP_PERIODE_D', to_char(
									greatest(	date_trunc('year', '[TOPERIODE]'::date) - interval '1 year',
												date_trunc('month', '[PERIODE]'::date) - interval '1 year')
									, 'YYYY-MM-DD')
					UNION ALL
						SELECT 'COMP_TOPERIODE_D', 	to_char(
									least(	date_trunc('year', '[TOPERIODE]'::date) - interval '1 day',
												'[TOPERIODE]'::date - interval '1 year')
									, 'YYYY-MM-DD')
						
				]]></select>
				<FIELDS>
					<FIELD name="name" />
					<FIELD name="value" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Dernier mois/année" shortLabel="Dernier mois/année"   rowContext="false" buttonType="VIEWLINKPOPUP">
				<VIEWITEM label="Dernier mois" shortLabel="Dernier mois"  view="ACTI000056.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,8)+'01';"/>
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;"/>
					<ARG name="GROUPBY" value="return 'JOURS';"/>
					<ARG name="GROUPBY_2" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="DATA4" value="'NAM';"/>
					<ARG name="DATA5" value="'NJNAS';"/>	
					<ARG name="TYPE_COMPARAISON" value="'2'" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
				</VIEWITEM>	
				<VIEWITEM label="&#8721; dernier mois" data="2" shortLabel="&#8721; dernier  mois"  view="ACTI000182.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,8)+'01';"/>
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="GROUPBY" value="return 'JOURS';"/>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="TYPE_COMPARAISON" value="return '2';" />
				</VIEWITEM>
				<VIEWITEM  label="Dernière année" data="2" shortLabel="derniere  année"  view="ACTI000056.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;"/>
					<ARG name="GROUPBY" value="return 'NUMEROMOIS';"/>
					<ARG name="GROUPBY_2" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_2;" />
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="DATA4" value="'NAM';"/>
					<ARG name="DATA5" value="'NJNAS';"/>	
					<ARG name="TYPE_COMPARAISON" value="'2'" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
				</VIEWITEM>	
				<VIEWITEM label="&#8721; dernière Année" shortLabel="&#8721; derniere année"  view="ACTI000182.XML" rowContext="false" enabled="true" buttonType="COMPARATIF">
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE_D" value="return VIEW.COMP_PERIODE_D;" />
					<ARG name="TOPERIODE_D" value="return VIEW.COMP_TOPERIODE_D;" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;" />
					<ARG name="GROUPBY" value="return 'NUMEROMOIS';"/>
					<ARG name="GROUPBY_2" value="return '-1';"/>
					<ARG name="GROUPBY_3" value="return '-1';"/>
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
			</VIEWLINK>
			<VIEWLINK label="Comparatif" shortLabel="Comparatif"  view="ACTI000056.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" >
					<ARG name="PERIODE" value="return VIEW.COMP_PERIODE;" />
					<ARG name="PERIODE_D" value="return VIEW.COMP_PERIODE_D;" />
					<ARG name="TOPERIODE_D" value="return VIEW.COMP_TOPERIODE_D;" />
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="DATA4" value="'NAM';"/>
					<ARG name="DATA5" value="'NJNAS';"/>	
					<ARG name="TYPE_COMPARAISON" value="'S'" />
			</VIEWLINK>			
			<VIEWLINK label="Comparatif mensuel" shortLabel="Comp. mensuel"  view="ACTI000169.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" >
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>
			<VIEWLINK label="Evolution comparative" shortLabel="Evol. comparative"   rowContext="false" buttonType="VIEWLINK_EVO_COMP" >			
				<VIEWITEM label="Standard" shortLabel="Evolution comparative" view="ACTI000173.XML" rowContext="false" enabled="true" buttonType="VIEWLINK_EVO_COMP">
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="return 'NUMEROMOIS';" />
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="DATA4" value="'NAM';"/>
					<ARG name="DATA5" value="'NJNAS';"/>					
					<ARG name="DATA6"   value="return '0';" />
					<ARG name="DATA7"   value="return '0';" />
					<ARG name="DATA8"   value="return '0';" />
					<ARG name="DATA9"   value="return '0';"/>
					<ARG name="DATA10" 	value="return '0';"/>			
					<ARG name="DATA011" value="return '0';" />
					<ARG name="DATA012" value="return '0';" />
					<ARG name="DATA013" value="return '0';" />
					<ARG name="DATA014" value="return '0';"/>
					<ARG name="DATA015" value="return '0';"/>
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;"/>
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;"/>
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;"/>
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
				<VIEWITEM label="Détaillée" shortLabel="Evol. comparative" view="ACTI000173.XML" rowContext="false" enabled="true" buttonType="COMPARATIF">
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="return 'NUMEROMOIS';" />
					<ARG name="DATA1" value="'NSEJ'" />
					<ARG name="DATA2" value="'NSD'" />
					<ARG name="DATA3" value="'NJN'" />
					<ARG name="DATA4" value="'NAM';"/>
					<ARG name="DATA5" value="'NJNAS';"/>					
					<ARG name="DATA6" value="'NSE'" />
					<ARG name="DATA7" value="'NEX'" />
					<ARG name="DATA8" value="'EMC'" />
					<ARG name="DATA9" value="'DMSHES';"/>
					<ARG name="DATA10" value="'DMSHON';"/>					
					<ARG name="DATA011" value="return '0';" />
					<ARG name="DATA012" value="return '0';" />
					<ARG name="DATA013" value="return '0';" />
					<ARG name="DATA014" value="return '0';"/>
					<ARG name="DATA015" value="return '0';"/>
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;"/>
					<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;"/>
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;"/>
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
			</VIEWLINK>	
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="ACTI000054.XML" rowContext="false" enabled="true" buttonType="EVOLUTION" componentName="PERIODICITE_VIEWLINK" component2Name="OCC_BASE_VIEWLINK" >
			</VIEWLINK>
			<VIEWLINK label="Répartition hebdomadaire" shortLabel="Répartition hebdo" view="ACTI000036.XML" rowContext="false" enabled="true" buttonType="EVOLUTION" componentName="OCC_BASE_VIEWLINK">
				<ARG name="DATA" value="'NSD'" />
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="ACTI000072.XML" enabled="true" rowContext="false" buttonType="ANALYSE_CROISEE" componentName="OCC_BASE_VIEWLINK" >
				<ARG name="PERIODE" value="return VIEW.ANA_CROI_PERIODE;" />
				<ARG name="TOPERIODE" value="return VIEW.ANA_CROI_TOPERIODE;" />
				<ARG name="COLUMNBY" value="'NUMEROMOIS'" />
				<ARG name="GROUPBY" value="'ANNEE'" />
				<ARG name="GROUPBY_2" value="if (SELECT.GROUPBY == 'ANNEE' || SELECT.GROUPBY == 'JOUR') {return 'SER';} else {return SELECT.GROUPBY;}" />
				<ARG name="LGROUPBY" value="return SELECT.GROUPBY;"/>
				<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;"/>
				<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;"/>				
				<ARG name="GROUPBY_TAB" value="'TAB'" />
				<ARG name="COLUMNBYCOUNT" value="'12'" />
			</VIEWLINK>
			<VIEWLINK label="Analyse" shortLabel="Analyse" view="ACTI000123.XML" enabled="true" rowContext="false" buttonType="ANALYSE" >
				<ARG name="ALIAS_PERIODE" value="return '-1'" />
				<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
				<ARG name="GROUPBY_2" value="reurn SELECT.GROUPBY_2" />
				<ARG name="GROUPBY_2" value="reurn SELECT.GROUPBY_3" />
				<ARG name="GROUPBY_TAB" value="return 'TAB';" />
				<ARG name="LGROUPBY" value="return SELECT.GROUPBY;"/>
				<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;"/>
				<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;"/>
			</VIEWLINK>	
			<VIEWLINK label="Liste des séjours" shortLabel="Séjours" view="ACTI000052.XML" componentName="OCC_BASE_VIEWLINK" component3Name="STANDARD_BASE_VIEWLINK">
				<ARG name="DATA" value="if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NED') {return 'ENT'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NEM') {return 'ENT'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NSD') {return 'SOR'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NSM') {return 'SOR'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NJN') {return 'JRN'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NJNM') {return 'JRN'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NCP') {return 'CP'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NEX') {return 'EXT'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NEXM') {return 'EXT'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NAM') {return 'AMB'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NAMM') {return 'AMB'}
										if ((COLUMN.NAME == 'D1' || COLUMN.NAME == 'F1')  &amp; SELECT.DATA1 == 'NSE') {return 'SEA'}
										
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NED') {return 'ENT'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NEM') {return 'ENT'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NSD') {return 'SOR'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NSM') {return 'SOR'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NJN') {return 'JRN'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NJNM') {return 'JRN'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NCP') {return 'CP'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NEX') {return 'EXT'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NEXM') {return 'EXT'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NAM') {return 'AMB'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NAMM') {return 'AMB'}
										if ((COLUMN.NAME == 'D2' || COLUMN.NAME == 'F2')  &amp; SELECT.DATA2 == 'NSE') {return 'SEA'}
										
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NED') {return 'ENT'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NEM') {return 'ENT'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NSD') {return 'SOR'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NSM') {return 'SOR'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NJN') {return 'JRN'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NJNM') {return 'JRN'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NCP') {return 'CP'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NEX') {return 'EXT'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NEXM') {return 'EXT'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NAM') {return 'AMB'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NAMM') {return 'AMB'}
										if ((COLUMN.NAME == 'D3' || COLUMN.NAME == 'F3')  &amp; SELECT.DATA3 == 'NSE') {return 'SEA'}
										
										return '-1'"/>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Comparatif" label="Comparatif" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
            <CHART title="" type="group" subType="h" percentHeight="100" fromTotal="false" >			
                <CHART title="Première donnée (10 premiers) " type="pieChart" maxItems="10" maxItemsSortOn="D1" maxItemsSortSeq="D" sortField="D1" sortSeq="D" condition="ROW.LVL == '1'">
                    <CATEGORY field="COD" type="Char"/>
                    <SERIE field="D1" displayName="SELECT.DATA13 + ' ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
                </CHART>
                <CHART title="Deuxième donnée (10 premiers)" type="columnChart" maxItems="10" maxItemsSortOn="F2" maxItemsSortSeq="D" sortField="F2" sortSeq="D" condition="ROW.LVL == '1'">
                    <CATEGORY field="COD" type="Char"/>
                    <SERIE field="D2" displayName="SELECT.DATA2_LABEL + ' ' + '( ' + VIEW.COMPAREPERIODETXT + ' )'" displayNameCalc="true"/>
                    <SERIE field="F2" displayName="SELECT.DATA2_LABEL + ' ' + '( N )'" displayNameCalc="true"/>
                </CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="false" key="COD" headerHeight="70" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" 
						sortable="= SELECT.GROUPBY_3 == '-1' &amp;&amp; (SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB')">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid" />
				<COLUMN dataField="COD" width="80" type="Char" visible="true" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="150" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres" />
				<COLUMN dataField="CODTXT" type="Char" width="200" visible="false" totalFunction="text" otherFunction="text" calc="true">
					<CALC formula="ROW.COD + ' ' + ROW.TXT.toString().substr(0,20)" />
				</COLUMN>
				<COLUMN dataField="D1" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &gt; 12){return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';} else {return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';}" headerTextCalc="true" description="=SELECT.DATA14 + '\n Période N : ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="F1" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &gt; 12){return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';} else {return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';}" headerTextCalc="true" description="=SELECT.DATA14 + '\n Période N-1 : ' + VIEW.PERIODE_D_LABEL + ' à ' + VIEW.TOPERIODE_D_LABEL" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="E1" type="Number" headerText="Ecart" width="85" visibleCondition="(SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' || SELECT.PRESENTATION == '4'" outputFormat="= SELECT.DATA12" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.D1 &lt; ROW.F1)) || (ROW.F1 &lt; ROW.D1)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.F1 &lt; ROW.D1)) || (ROW.D1 &lt; ROW.F1)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D1 == ROW.F1" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="P1" type="Number" headerText="%" width="45" visibleCondition="(SELECT.PRESENTATION != '1') &amp;&amp; (SELECT.PRESENTATION != '2') &amp;&amp; (SELECT.PRESENTATION == '4') || (SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA1 !='0')" outputFormat="= if (ROW.D1 != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2" width="85" visibleCondition="SELECT.DATA2 != '-1' " type="Number" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &gt; 12){return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';} else {return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';}" description="=SELECT.DATA24 + '\n Période N-1 : ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="F2" width="85" visibleCondition="SELECT.DATA2 != '-1'" type="Number" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &gt; 12){return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';} else {return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';}" description="=SELECT.DATA24 + '\n Période N-1 : ' + VIEW.PERIODE_D_LABEL + ' à ' + VIEW.TOPERIODE_D_LABEL" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="E2" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA2 != '-1'  &amp;&amp; (SELECT.PRESENTATION == '1' )  || SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA2 !='0'  || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='0' " outputFormat="= SELECT.DATA22" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA2.substr(0,3) == 'DEL' &amp;&amp; (ROW.D2 &lt; ROW.F2)) || (ROW.F2 &lt; ROW.D2)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA2.substr(0,3) == 'DEL' &amp;&amp; (ROW.F2 &lt; ROW.D2)) || (ROW.D2 &lt; ROW.F2)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D2 == ROW.F2" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="P2" type="Number" headerText="%  " width="70" visibleCondition="SELECT.DATA2 != '-1' &amp;&amp; (SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp; (SELECT.PRESENTATION != '1') || (SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA2 !='0') || (SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='0')" outputFormat="= if (ROW.D2 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D3" width="85" visibleCondition="SELECT.DATA3 != '-1'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &gt; 12){return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';} else {return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';}" headerTextCalc="true" description="=SELECT.DATA34 + '\n Période N-1 : ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL" textAlign="center" totalFunction="sum" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>	
				<COLUMN dataField="F3" width="85" visibleCondition="SELECT.DATA3 != '-1'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &gt; 12){return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';} else {return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';}"  headerTextCalc="true" description="=SELECT.DATA34 + '\n Période N-1 : ' + VIEW.PERIODE_D_LABEL + ' à ' + VIEW.TOPERIODE_D_LABEL" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>	
				<COLUMN dataField="E3" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA3 != '-1'  &amp;&amp; (SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA3 !='0' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='0'" outputFormat="= SELECT.DATA32" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.D3 &lt; ROW.F3)) || (ROW.F3 &lt; ROW.D3)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.F3 &lt; ROW.D3)) || (ROW.D3 &lt; ROW.F3)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D3 == ROW.F3" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>	
				<COLUMN dataField="P3" type="Number" headerText="%  " width="45" visibleCondition="SELECT.DATA3 != '-1' &amp;&amp; (SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp;  (SELECT.PRESENTATION != '1') || SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA3 !='0' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='0'" outputFormat="= if (ROW.D3 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="MD1" width="85"  type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &lt; 13){return SELECT.DATA13 + String.fromCharCode(13)+'\n'+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} else {return SELECT.DATA13 + String.fromCharCode(13)+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="MF1" width="85"  type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &lt; 13) {return SELECT.DATA13 + String.fromCharCode(13)+'\n' +SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA13 + String.fromCharCode(13)+ SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;'}" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="ME1" type="Number" headerText="Ecart" width="85" visibleCondition="(SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' || SELECT.PRESENTATION == '4'"  outputFormat="= SELECT.DATA12" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MD1 &lt; ROW.MF1)) || (ROW.MF1 &lt; ROW.MD1)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MF1 &lt; ROW.MD1)) || (ROW.MD1 &lt; ROW.MF1)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.MD1 == ROW.MF1" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="MP1" type="Number" headerText="%" width="45" visibleCondition="(SELECT.PRESENTATION == '4')  &amp;&amp; (SELECT.PRESENTATION != '1') || (SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA1 !='0') || (SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA1 !='0')" outputFormat="= if (ROW.MD1) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="MD2" width="85"  type="Number" visibleCondition="SELECT.DATA2 != '-1'" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &lt; 13) {return SELECT.DATA23 + String.fromCharCode(13)+'\n'+VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA23 + String.fromCharCode(13)+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="MF2" width="85"  type="Number" visibleCondition="SELECT.DATA2 != '-1'"  outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &lt; 13) {return SELECT.DATA23 +String.fromCharCode(13)+'\n'+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA23 +String.fromCharCode(13)+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} " headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="ME2" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA2 != '-1'  &amp;&amp; (SELECT.PRESENTATION == '1')  || (SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA2 !='0')  || (SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='0') " outputFormat="= SELECT.DATA22" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MD2 &lt; ROW.MF2)) || (ROW.MF2 &lt; ROW.MD2)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MF2 &lt; ROW.MD2)) || (ROW.MD2 &lt; ROW.MF2)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.MD2 == ROW.MF2" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="MP2" type="Number" headerText="%" width="45" visibleCondition=" (SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.DATA2 != '-1' &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp; (SELECT.PRESENTATION != '1' || SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA2 !='-1' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='-1')"  outputFormat="= if (ROW.MD2 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="MD3" width="85" visibleCondition="SELECT.DATA3 != '-1'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &lt; 13){return SELECT.DATA33 + String.fromCharCode(13)+'\n'+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} else {return SELECT.DATA33 + String.fromCharCode(13)+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}" headerTextCalc="true" description="Mois N-1" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="MF3" width="85" visibleCondition="SELECT.DATA3 != '-1'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &lt; 13) {return SELECT.DATA33 +String.fromCharCode(13)+'\n'+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA33 +String.fromCharCode(13)+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} " headerTextCalc="true" description="Mois N" textAlign="center" totalFunction="sum" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="ME3" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA3 != '-1' &amp;&amp; SELECT.PRESENTATION != '2'  &amp;&amp; (SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA3 !='-1' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='-1'" outputFormat="= SELECT.DATA32" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.MD3 &lt; ROW.MF3)) || (ROW.MF3 &lt; ROW.MD3)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.MF3 &lt; ROW.MD3)) || (ROW.MD3 &lt; ROW.MF3)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.MD3 == ROW.MF3" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="MP3" type="Number" headerText="%" width="45" visibleCondition="(SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.DATA3 != '-1' &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp; (SELECT.PRESENTATION != '1') || SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA3 !='-1' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='-1'" outputFormat="= if (ROW.MD3 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>