<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000231" label="PMSI. Comparaison DMS" title="= 'Comparaison DMS par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ' vs ' + SELECT.PERIODE_D_LABEL + ' à ' + SELECT.TOPERIODE_D_LABEL + ') - ' + SELECT.VERSION_GROUPAGE_LABEL" database="iCTI" swf="*CTI_view1" softCode="iCTI_pmsi" globals="PMSI_globals.XML" componentsFile="PMSI_components.XML" helpDokuWIkiDir="pmsi:sejours_analyse_globale:dms" helpDokuWIkiFile="pmsi000013"  helpFile="iCTI_PMSI_PMSI000231.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_RSS" />
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE" />
	<VIEWPROPERTIES>
		<PROPERTY name="DATAFUNC">
			<value><![CDATA[[EVAL 
				// <?php
				
				function PMSI000231_dmsNat($tmp0, $sumCaseWhen, $ctiDivision) {
					$tmp1 = sprintf($sumCaseWhen, $tmp0, '[VIEW.DMS_FIELD]');
					$tmp2 = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
					return sprintf($ctiDivision, $tmp1, $tmp2);
				}
				
				function PMSI000231_dmsEts($tmp0, $sumCaseWhen, $ctiDivision) {
					$tmp1 = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
					$tmp2 = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
					return sprintf($ctiDivision, $tmp1, $tmp2);
				}
				
				function PMSI000231_calcSQL($data) {
					
					// Pas de donnée sélectionnée, on renvoie des valeurs à zéro
					if ($data == '0') {
						return '0, 0';
					}
				
					$ctiDivision = "base.cti_division(%s, %s)";
					$sumCaseWhen = "sum(CASE WHEN date_sortie BETWEEN @date_debut@ AND @date_fin@ %s THEN %s ELSE 0 END)";
					
					$periodeDebut = '\'[PERIODE]\'::date';
					$periodeFin = '\'[TOPERIODE]\'::date';
					$periodePrecDebut = '\'[PERIODE_D]\'::date';
					$periodePrecFin = '\'[TOPERIODE_D]\'::date';
					$tmp0 = '';
					
					switch ($data) {
						case 'DMSETS':		// DMS établissement
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmp = PMSI000231_dmsEts($tmp0, $sumCaseWhen, $ctiDivision);
							break;
						case 'ECARTDMS':	// Ecart DMS
							$tmp0 = ' AND cmd_code <> \'28\' ';
							// DMS NAT
							$tmpA = PMSI000231_dmsNat($tmp0, $sumCaseWhen, $ctiDivision);
							//DMS ETS
							$tmpB = PMSI000231_dmsEts($tmp0, $sumCaseWhen, $ctiDivision);
							$tmp = '(' . $tmpB . ' - ' . $tmpA . ')';
							break;
						case 'NBSEJ':		// Nombre de séjours
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case 'NBJOUR':		// Nombre de journées
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
							break;
						case 'NBJTHEO':		// Nombre de journées théoriques
							// Nombre de dossiers
							$tmpA = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							// DMS NAT
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmpB = PMSI000231_dmsNat($tmp0, $sumCaseWhen, $ctiDivision);
							$tmp = '(' . $tmpB . ' * ' . $tmpA . ')';
							break;
						case 'PERF':		// Performance ATIH
							// Nombre de dossiers
							$tmpA = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							// DMS NAT
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmpB = PMSI000231_dmsNat($tmp0, $sumCaseWhen, $ctiDivision);
							$tmpC = '(' . $tmpB . ' * ' . $tmpA . ')';
							// Nombre de journées
							$tmpD = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
							$tmp = sprintf($ctiDivision, $tmpC, $tmpD);
							break;
						case 'PERFB':		// Performance ANAP
							// Nombre de dossiers
							$tmpA = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							// DMS NAT
							$tmp0 = ' AND cmd_code <> \'28\' ';
							$tmpB = PMSI000231_dmsNat($tmp0, $sumCaseWhen, $ctiDivision);
							$tmpC = '(' . $tmpB . ' * ' . $tmpA . ')';
							// Nombre de journées
							$tmpD = sprintf($sumCaseWhen, $tmp0, 'duree_sejour');
							$tmp = sprintf($ctiDivision, $tmpD, $tmpC);
							break;
						case 'BENEF':		// Jours bénéficiaires
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] < 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, '0 - ecart_[VIEW.DMS_FIELD]');
							break;
						case 'INDUS':		// Jours indus
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] > 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'ecart_[VIEW.DMS_FIELD]');
							break;
						case 'RATIOBENEFINDUS':		// Ratio Indus / Bénéficiaires
							// Jours bénéficiaires
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] < 0 ';
							$tmpA = sprintf($sumCaseWhen, $tmp0, '0 - ecart_[VIEW.DMS_FIELD]');
							// Jours indus
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] > 0 ';
							$tmpB = sprintf($sumCaseWhen, $tmp0, 'ecart_[VIEW.DMS_FIELD]');
							$tmp = sprintf($ctiDivision, $tmpB, $tmpA);
							break;
						case 'SEJDMSINF':	// Séjours < DMS Ref
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] < 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case 'SEJDMS':		// Séjours = DMS Ref
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 0 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case 'SEJDMS1':		// Séjours = DMS Ref + 1
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 1 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case 'SEJDMS2':		// Séjours = DMS Ref + 2
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 2 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case 'SEJDMS3':		// Séjours = DMS Ref + 3
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] = 3 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						case 'SEJDMS3X':	// Séjours > DMS Ref + 3
							$tmp0 = ' AND ecart_[VIEW.DMS_FIELD] > 3 ';
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
							break;
						default :	// Nombre de séjours par défaut
							$tmp = sprintf($sumCaseWhen, $tmp0, 'nb_rsa');
					}
					
					$toReplace = array(
						'@date_debut@',
						'@date_fin@'
					);
					
					$curPeriod = array(
						$periodeDebut,
						$periodeFin
					);
					
					$prevPeriod = array(
						$periodePrecDebut,
						$periodePrecFin
					);
					
					return str_replace($toReplace, $curPeriod, $tmp) . ', ' . str_replace($toReplace, $prevPeriod, $tmp);
				}
				
				// ?>
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATASQL">
			<value><![CDATA[[EVAL 
				// <?php
				
				return 
					PMSI000231_calcSQL('[DATA1]') . ', 0, 0, ' . PHP_EOL . 
					PMSI000231_calcSQL('[DATA2]') . ', 0, 0, ' . PHP_EOL . 
					PMSI000231_calcSQL('[DATA3]') . ', 0, 0, ' . PHP_EOL . 
					PMSI000231_calcSQL('NBJOUR');
				
				// ?>
			EVAL]]]></value>
		</PROPERTY>
	</VIEWPROPERTIES>
	<SELECTIONS label="">
		<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="Période" UI="combo" tree="true" width="150" default="2014-07-01" printable="false" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2014-12-31" printable="false" globalListProvider="DATE_FIN" />
		</GROUP>
		<GROUP label="Période précédente">
			<FIELD name="PERIODE_D" label="" UI="combo" tree="true" width="150" default="2014-01-01" printable="false" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="150" default="2014-06-30" printable="false" globalListProvider="DATE_FIN" />
		</GROUP>
		<GROUP>
			<FIELD name="DATA1" label="Données" UI="combo" default="DMSETS" default2="DMS Ets" default3="DMS établissement" default4="#,0" tree="true" printable="false">
				<OPTION label="Options" data="" globalListProvider="DATA_DMS" />
			</FIELD>
			<FIELD name="DATA2" label="" UI="combo" default="0" default2="0" default3="0" default4="0" tree="true" printable="false">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_DMS" />
			</FIELD>
			<FIELD name="DATA3" label="" UI="combo" default="0" default2="0" default3="0" default4="0" tree="true" printable="false">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_DMS" />
			</FIELD>
		</GROUP>
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="220" label="" UI="combo" default="4" tree="true">
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS" />
			</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" width="220" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>		
        <GROUP label="">
			<FIELD name="GROUPBY_3" width="220" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de troisième niveau" data="-1" />
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS" />
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="SHOWDMSREF" label="" width="1" UI="text" default="1" printable="false" visible="false" />
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_RSS_SOUSSELECTIONS" />
	<SELECTIONS componentName="FILTRES_RSS_SELECTIONS" />
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_RSS_X" cacheEnabled="true">
				<select><![CDATA[ 
					
					CTISELECT_TREE
						GROUPBY1{[VIEW.SELECT_TABTREE_OID_FIELD],, [VIEW.SELECT_TABTREE_COD_FIELD],, [VIEW.SELECT_TABTREE_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.SELECT_TABTREE_2_OID_FIELD],, [VIEW.SELECT_TABTREE_2_COD_FIELD],, [VIEW.SELECT_TABTREE_2_TXT_FIELD]}
						GROUPBY3{[VIEW.SELECT_TABTREE_3_OID_FIELD],, [VIEW.SELECT_TABTREE_3_COD_FIELD],, [VIEW.SELECT_TABTREE_3_TXT_FIELD]}
						SIGNIFDATA{[VIEW.SELECT_TABTREE_ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
						OPTIONS{NOTZERO=1}
						ORDERBY{[VIEW.DATA1],, DESC}
						INDICATORS{
							[VIEW.DATASQL]
						}
					FROM 
						#V_RSS_X#
					WHERE 1=1
						AND (
							mois_sortie IN ([VIEW.PERIODE_D_MOIS_LIST]) AND date_sortie BETWEEN '[PERIODE_D]' AND '[TOPERIODE_D]' 
							OR 
							mois_sortie IN ([VIEW.PERIODE_MOIS_LIST]) AND date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						)
						[VIEW.FILTRE_RSS_SELECT]
						
					AFTER{
						UPDATE w_table SET 
							indicateurs[3] = indicateurs[1] - indicateurs[2],
							indicateurs[4] = CASE 
												WHEN indicateurs[1] > 0 AND indicateurs[2] > 0 THEN base.cti_division(indicateurs[1] - indicateurs[2], indicateurs[2]) * 100
											 ELSE 0 END,
							indicateurs[7] = indicateurs[5] - indicateurs[6],
							indicateurs[8] = CASE 
												WHEN indicateurs[5] > 0 AND indicateurs[6] > 0 THEN base.cti_division(indicateurs[5] - indicateurs[6], indicateurs[6]) * 100
											 ELSE 0 END,
							indicateurs[11] = indicateurs[9] - indicateurs[10],
							indicateurs[12] = CASE 
												WHEN indicateurs[9] > 0 AND indicateurs[10] > 0 THEN base.cti_division(indicateurs[9] - indicateurs[10], indicateurs[10]) * 100
											  ELSE 0 END
					}
					
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS" />
					<FIELD name="SORT" />
					
					<!-- Première donnée -->
					<FIELD name="D1_NOW" />
					<FIELD name="D1_OLD" />
					<FIELD name="D1_ECA" />
					<FIELD name="D1_PCT" />
					
					<!-- Deuxième donnée -->
					<FIELD name="D2_NOW" />
					<FIELD name="D2_OLD" />
					<FIELD name="D2_ECA" />
					<FIELD name="D2_PCT" />
					
					<!-- Troisième donnée -->
					<FIELD name="D3_NOW" />
					<FIELD name="D3_OLD" />
					<FIELD name="D3_ECA" />
					<FIELD name="D3_PCT" />
					
					<!-- Premier graphique (Nombre de séjours) -->
					<FIELD name="NB_NOW" />
					<FIELD name="NB_OLD" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Liste des RSS" shortLabel="Liste RSS" view="PMSI000005.XML" componentName="RSS_BASE_VIEWLINK" component2Name="DATE_COMP_2_VIEWLINK">
				<ARG name="T_ECART_DMS">
					<value><![CDATA[ 
								
								if (String(COLUMN.NAME).substr(0,2) == 'D1' && String(SELECT.DATA1).indexOf('SEJDMS') >= 0 || 
									String(COLUMN.NAME).substr(0,2) == 'D2' && String(SELECT.DATA2).indexOf('SEJDMS') >= 0 || 
									String(COLUMN.NAME).substr(0,2) == 'D3' && String(SELECT.DATA3).indexOf('SEJDMS') >= 0)
									{ return '1';}
							]]></value>
				</ARG>
				<ARG name="ECART_DMS_OPERATOR" value="
												var col:String = String(COLUMN.NAME).substr(0,2);
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMSINF' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMSINF' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMSINF')
													{return '3';}
												if (col == 'D1' &amp;&amp; (SELECT.DATA1 == 'SEJDMS' || SELECT.DATA1 == 'SEJDMS1' || SELECT.DATA1 == 'SEJDMS2' || SELECT.DATA1 == 'SEJDMS3') || 
													col == 'D2' &amp;&amp; (SELECT.DATA2 == 'SEJDMS' || SELECT.DATA2 == 'SEJDMS1' || SELECT.DATA2 == 'SEJDMS2' || SELECT.DATA2 == 'SEJDMS3') || 
													col == 'D3' &amp;&amp; (SELECT.DATA3 == 'SEJDMS' || SELECT.DATA3 == 'SEJDMS1' || SELECT.DATA3 == 'SEJDMS2' || SELECT.DATA3 == 'SEJDMS3'))
													{return '1';}
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMS3X' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMS3X' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMS3X')
													{return '2';}" />
				<ARG name="ECART_DMS_FIELD1" value="
												var col:String = String(COLUMN.NAME).substr(0,2);
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMSINF' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMSINF' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMSINF')
													{return '-1';}
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMS' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMS' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMS')
													{return '0';}
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMS1' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMS1' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMS1')
													{return '1';}
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMS2' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMS2' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMS2')
													{return '2';}
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMS3' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMS3' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMS3')
													{return '3';}
												if (col == 'D1' &amp;&amp; SELECT.DATA1 == 'SEJDMS3X' || 
													col == 'D2' &amp;&amp; SELECT.DATA2 == 'SEJDMS3X' || 
													col == 'D3' &amp;&amp; SELECT.DATA3 == 'SEJDMS3X')
													{return '4';}" />
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Comparaison DMS" label="Comparaison DMS" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHART title="Nombre de journées pour les 12 premiers" type="columnChart" maxItems="12" maxItemsSortOn="NB_NOW" maxItemsSortSeq="D" sortField="CODTXT" sortSeq="A" condition="ROW.LVL == '1'">
				<CATEGORY field="CODTXT" type="Char" />
				<SERIE field="NB_OLD" displayName="'Nb ' + SELECT.PERIODE_D_LABEL + '-' + SELECT.TOPERIODE_D_LABEL" displayNameCalc="true" />
				<SERIE field="NB_NOW" displayName="'Nb ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true" />
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="54" variableRowHeight="true" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" sortable="= SELECT.GROUPBY_3 == '-1' || SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<COLUMN dataField="NB_OLD" visible="false" />
				<COLUMN dataField="NB_NOW" visible="false" />
				<COLUMN dataField="LVL" width="50" type="Char" visible="false" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" />
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid" />
				<COLUMN dataField="COD" width="70" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<CELLSTYLE name="paddingLeft" value="15" condition="ROW.LVL == '2' &amp;&amp; SELECT.GROUPBY_TAB != 'TAB'" />
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="200" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres" >
				</COLUMN>
				<COLUMN dataField="CODTXT" type="Char" minWidth="200" visible="false" totalFunction="text" otherFunction="text" calc="true">
					<CALC formula="ROW.COD + ' ' + ROW.TXT.toString().substr(0,10)" />
				</COLUMN>
				
				<COLUMN dataField="D1_OLD" type="Number" width="85" outputFormat="= SELECT.DATA12" selectable="true" headerText="SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\n' + SELECT.DATA13" headerTextCalc="true" description="=SELECT.DATA15" >
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_NOW" type="Number" width="85" outputFormat="= SELECT.DATA12" selectable="true" headerText="SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\n' + SELECT.DATA13" headerTextCalc="true" description="=SELECT.DATA15">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_ECA" type="Number" width="70" outputFormat="= SELECT.DATA12" headerText="Ecart">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA14 == 'P' &amp;&amp; ROW.D1_NOW &lt; ROW.D1_OLD) || (SELECT.DATA14 == 'N' &amp;&amp; ROW.D1_NOW &gt; ROW.D1_OLD)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA14 == 'P' &amp;&amp; ROW.D1_NOW &gt; ROW.D1_OLD) || (SELECT.DATA14 == 'N' &amp;&amp; ROW.D1_NOW &lt; ROW.D1_OLD)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D1_NOW != null &amp;&amp; ROW.D1_OLD != null &amp;&amp; ROW.D1_NOW == ROW.D1_OLD" />
					<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<HEADERCELLSTYLE name="textAlign" value="center"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>				
				</COLUMN>
				<COLUMN dataField="D1_PCT" type="Number" width="45" outputFormat="= if (ROW.D1_OLD != 0) {return '0%'} else {return '#'}" headerText="% évol." >
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				
				<COLUMN dataField="D2_OLD" type="Number" width="85" visibleCondition="SELECT.DATA2 != '0'" outputFormat="= SELECT.DATA22" selectable="true" headerText="SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\n' + SELECT.DATA23" headerTextCalc="true" description="=SELECT.DATA25" >
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_NOW" type="Number" width="85" visibleCondition="SELECT.DATA2 != '0'" outputFormat="= SELECT.DATA22" selectable="true" headerText="SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\n' + SELECT.DATA23" headerTextCalc="true" description="=SELECT.DATA25" >
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_ECA" type="Number" width="70" visibleCondition="SELECT.DATA2 != '0'" outputFormat="= SELECT.DATA22" headerText="Ecart">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA24 == 'P' &amp;&amp; ROW.D2_NOW &lt; ROW.D2_OLD) || (SELECT.DATA24 == 'N' &amp;&amp; ROW.D2_NOW &gt; ROW.D2_OLD)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA24 == 'P' &amp;&amp; ROW.D2_NOW &gt; ROW.D2_OLD) || (SELECT.DATA24 == 'N' &amp;&amp; ROW.D2_NOW &lt; ROW.D2_OLD)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D2_NOW != null &amp;&amp; ROW.D2_OLD != null &amp;&amp; ROW.D2_NOW == ROW.D2_OLD" />
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<HEADERCELLSTYLE name="textAlign" value="center"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_PCT" type="Number" width="45" visibleCondition="SELECT.DATA2 != '0'" outputFormat="= if (ROW.D2_OLD != 0) {return '0%'} else {return '#'}" headerText="% évol." >
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				
				<COLUMN dataField="D3_OLD" type="Number" width="85" visibleCondition="SELECT.DATA3 != '0'" outputFormat="= SELECT.DATA32" selectable="true" headerText="SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\n' + SELECT.DATA33" headerTextCalc="true" description="=SELECT.DATA35" >
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D3_NOW" type="Number" width="85" visibleCondition="SELECT.DATA3 != '0'" outputFormat="= SELECT.DATA32" selectable="true" headerText="SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\n' + SELECT.DATA33" headerTextCalc="true" description="=SELECT.DATA35" >
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D3_ECA" type="Number" width="70" visibleCondition="SELECT.DATA3 != '0'" outputFormat="= SELECT.DATA32" headerText="Ecart">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA34 == 'P' &amp;&amp; ROW.D3_NOW &lt; ROW.D3_OLD) || (SELECT.DATA34 == 'N' &amp;&amp; ROW.D3_NOW &gt; ROW.D3_OLD)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA34 == 'P' &amp;&amp; ROW.D3_NOW &gt; ROW.D3_OLD) || (SELECT.DATA34 == 'N' &amp;&amp; ROW.D3_NOW &lt; ROW.D3_OLD)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D3_NOW != null &amp;&amp; ROW.D3_OLD != null &amp;&amp; ROW.D3_NOW == ROW.D3_OLD" />
					<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<HEADERCELLSTYLE name="textAlign" value="center"/>
				    <FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D3_PCT" type="Number" width="45" visibleCondition="SELECT.DATA3 != '0'" outputFormat="= if (ROW.D3_OLD != 0) {return '0%'} else {return '#'}" headerText="% évol." >
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
