<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="PMSI000366" label="PMSI. Effets Prix - Volume" title="= 'Effets Prix - Volume par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ' vs ' + SELECT.PERIODE_D_LABEL + ' à ' + SELECT.TOPERIODE_D_LABEL + ')' + ' sur le ' + SELECT.DATA02_LABEL + ' et les ' + SELECT.DATA01_LABEL " database="iCTI" swf="*CTI_view1" softCode="iCTI_pmsi" typeEts="" globals="PMSI_globals.XML" componentsFile="PMSI_components.XML" helpDokuWIkiDir="pmsi:sejours_analyse_globale:rss:chiffre_d_affaire_rss" helpDokuWIkiFile="pmsi000007"  helpFile="iCTI_PMSI_PMSI000037.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_RSS" />
	<VIEWPROPERTIES componentName="PROPERTIES_SELECT_TABTREE" />
	<VIEWPROPERTIES>
		<PROPERTY name="DATAFUNC">
			<value><![CDATA[[EVAL 
				// <?php
				
				function PMSI000366_calcSQL($data) {
					
					$ctiDivision = "base.cti_division(%s, %s)";
					$countDistinctCaseWhen = "count(DISTINCT CASE WHEN date_sortie BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE null END)";
					$sumCaseWhen = "sum(CASE WHEN date_sortie BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE 0 END)";
					$periodeDebut = '\'[PERIODE]\'::date';
					$periodeFin = '\'[TOPERIODE]\'::date';
					$periodePrecDebut = '\'[PERIODE_D]\'::date';
					$periodePrecFin = '\'[TOPERIODE_D]\'::date';
					
					switch ($data) {
						case '1.1':	// Nombre de séjours
							$tmp = sprintf($sumCaseWhen, 'nb_rsa');
							break;
						case '1.2':	// Nombre de séjours 0 nuit
							$tmp = sprintf($sumCaseWhen, 'nb_rsa_0n');
							break;
						case '1.3':	// Nombre de séjours 1 nuit
							$tmp = sprintf($sumCaseWhen, 'nb_rsa_1n');
							break;
                        case '1.14':	// Nombre de séjours hospitalisé
							$tmp = sprintf($sumCaseWhen, 'nb_rsa_1n + nb_rsa_2n + nb_rsa_xn');
							break;
						
						default :	// Nombre de séjours par défaut
							$tmp = sprintf($sumCaseWhen, '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);
				}
                
                function PMSI000366_CA_calcSQL($data,$data2) {
					
					
					$ctiDivision = "base.cti_division(%s, %s)";
					$countDistinctCaseWhen = "count(DISTINCT CASE WHEN date_sortie BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE null END)";
					$sumCaseWhen = "sum(CASE WHEN date_sortie BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE 0 END)";
					$sumCaseWhen2 = "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';
					
					switch ($data) {
						case '1.1':
                            switch ($data2) {
                                case '1':	// CA établissement
                                    $tmp = sprintf($sumCaseWhen, 'base_remboursement');
                                    break;
                                case '2':	// CA T2A
                                    $tmp = sprintf($sumCaseWhen, 't2a_facture');
                                    break;
								case '3':	// CA GHS
                                    $tmp = sprintf($sumCaseWhen, 'ca_ghs');
                                    break;
                                }
                        break;
                        case '1.2':
                            switch ($data2) {
                                case '1':	// CA établissement 0 nuit
                                    $tmp0 = ' AND ( nb_seances > \'0\' OR nb_rsa_0n > \'0\' )';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 'base_remboursement');
                                    break;
                                case '2':	// CA T2A 0 nuit
                                    $tmp0 = ' AND ( nb_seances > \'0\' OR nb_rsa_0n > \'0\' )';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 't2a_facture');
                                    break;
								case '3':	// CA GHS 0 nuit
                                    $tmp0 = ' AND ( nb_seances > \'0\' OR nb_rsa_0n > \'0\' )';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 'ca_ghs');
                                    break;
                                }
                        break;
                        case '1.3':
                            switch ($data2) {
                                case '1':	// CA établissement 1 nuit
                                    $tmp0 = ' AND nb_rsa_1n > \'0\' ';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 'base_remboursement');
                                    break;
                                case '2':	// CA T2A 1 nuit
                                    $tmp0 = ' AND nb_rsa_1n > \'0\' ';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 't2a_facture');
                                    break;
								case '3':	// CA GHS 1 nuit
                                    $tmp0 = ' AND nb_rsa_1n > \'0\' ';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 'ca_ghs');
                                    break;
                                }
                        break;
                        case '1.14':
                            switch ($data2) {
                                case '1':	// CA établissement hospitalisé
                                    $tmp0 = ' AND (nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\')';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 'base_remboursement');
                                    break;
                                case '2':	// CA T2A hospitalisé
                                    $tmp0 = ' AND (nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\')';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 't2a_facture');
                                    break;
								case '3':	// CA GHS hospitalisé
                                    $tmp0 = ' AND (nb_rsa_1n > \'0\' OR nb_rsa_xn > \'0\' OR nb_rsa_2n > \'0\')';
                                    $tmp = sprintf($sumCaseWhen2, $tmp0, 'ca_ghs');
                                    break;
                                }
                        break;
						default :	// Nombre de séjours par défaut
							$tmp = sprintf($sumCaseWhen, 'base_remboursement');
					}
					
					$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 
					PMSI000366_calcSQL('[DATA01]') . ', 0, 0, ' . PHP_EOL . 
					PMSI000366_CA_calcSQL('[DATA01]','[DATA02]'). ', 0 '; 
				// ?>
			EVAL]]]></value>
		</PROPERTY>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période">
			<FIELD name="PERIODE" label="" 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="DATA01" label="Données" UI="combo" tree="true" width="200" default="1.1" default2="1.1" default3="Séjours" default4="P" printable="false">
                <OPTION label="Séjours" data="1.1" data2="#" data3="Nombre de séjours. Pour les séjours de la CMD 28, nombre de séances" data4="P" treeLevel="1"/>
                <OPTION label="Séjours 0 nuit" data="1.2" data2="#" data3="Nombre de séjours hors CMD 28 dont la durée est 0 jour" data4="P" treeLevel="1"/>
                <OPTION label="Séjours 1 nuit" data="1.3" data2="#" data3="Nombre de séjours hors CMD 28 dont la durée est 1 jour" data4="P" treeLevel="1"/>
                <OPTION label="Séjours hospitalisés" data="1.14" data2="#" data3="Nombre de séjours dont la durée est supérieure ou égale à 1 jour" data4="P" treeLevel="1"/>
			</FIELD>
            <FIELD name="DATA02" label="Données" UI="combo" tree="true" width="200" default="2" default2="2" default3="Séjours" default4="P" printable="false">
                <OPTION label="CA établissement" data="1" data2="#E" data3="Somme des montants liés à la T2A (GHS, forfaits, suppléments) ainsi que des DMI et UCD en sus." data4="P" treeLevel="1" />			
                <OPTION label="Chiffre d'affaires T2A" data="2" data2="#E" data3="Somme du montant des prestations liées à la T2A (GHS, suppléments, forfaits). Les prestations comprises dans le calcul du CA T2A sont celles des sections T2A. GHS, T2A. EXH, T2A. Forfaits et suppléments et T2A. Autres." data4="P" treeLevel="1" />
				<OPTION label="CA GHS" data="3" data2="#E" data3="Chiffre d'affaire GHS." data4="P" treeLevel="1" />
			</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" treeLevel="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" treeLevel="1" />
				<OPTION label="Options" data="" globalListProvider="RSS_GROUPBY_OPTIONS" />
			</FIELD>
		</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.DATA01],, 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
					}
					
				]]></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" />
					
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Comparatif" shortLabel="Comparatif" view="PMSI000037.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
				<ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
                <ARG name="DATA1" value="'1.1'" />
                <ARG name="DATA2" value="'2.1'" />
                <ARG name="DATA3" value="'2.4'" />
                <ARG name="DATA4" value="'2.5'" />
                <ARG name="DATA5" value="'2.2'" />
                <ARG name="DATA6" value="'2.3'" />
                <ARG name="DATA7" value="'1.11'" />
                <ARG name="DATA8" value="'1.9'" />
                <ARG name="DATA9" value="'3.1'" />
                <ARG name="DATA010" value="'0'" />
                <ARG name="DATA011" value="'0'" />
                <ARG name="DATA012" value="'0'" />
                <ARG name="DATA013" value="'0'" />
                <ARG name="DATA014" value="'0'" />
                <ARG name="DATA015" value="'0'" />
			</VIEWLINK>			
            <VIEWLINK label="Comparatif mensuel" shortLabel="Comp. Mensuel" view="PMSI000437.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
				<ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
                <ARG name="DATA1" value="'1.1'" />
                <ARG name="DATA2" value="'2.1'" />
                <ARG name="DATA3" value="'2.4'" />
			</VIEWLINK>
            <VIEWLINK label="Effets" shortLabel="Effets" view="PMSI000366.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
				<ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
				<ARG name="DATA1" value="'1.1'" />
				<ARG name="DATA2" value="'2.2'" />
			</VIEWLINK>
			<VIEWLINK label="Evolution comparative" shortLabel="Evol. comparative"  view="PMSI000438.XML"  rowContext="false" componentName=""  enabled="true" buttonType="VIEWLINK_EVO_COMP_1" >			
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="'MSOR'" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
                    <ARG name="DATA1" value="'1.1'" />
                    <ARG name="DATA2" value="'2.1'" />
                    <ARG name="DATA3" value="'2.4'" />
                    <ARG name="DATA4" value="'2.5'" />
                    <ARG name="DATA5" value="'2.2'" />
                    <ARG name="DATA6" value="'2.3'" />
                    <ARG name="DATA7" value="'1.11'" />
                    <ARG name="DATA8" value="'1.9'" />
                    <ARG name="DATA9" value="'3.1'" />
                    <ARG name="DATA010" value="'0'" />
                    <ARG name="DATA011" value="'0'" />
                    <ARG name="DATA012" value="'0'" />
                    <ARG name="DATA013" value="'0'" />
                    <ARG name="DATA014" value="'0'" />
                    <ARG name="DATA015" value="'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;"/>
			</VIEWLINK>	
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="PMSI000036.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" buttonType="EVOLUTION">
				<ARG name="DATA" value="'1.1" />
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="PMSI000213.XML" enabled="true" rowContext="false" buttonType="ANALYSE_CROISEE">
				<ARG name="ALIAS_PERIODE" value="'-1'" />
                <ARG name="PERIODE" value="return VIEW.X_PERIODE;" />
				<ARG name="DATA" value="'1.1'" />
				<ARG name="COLUMNBY" value="'MSOR'" />
				<ARG name="GROUPBY" value="'ASOR'" />
				<ARG name="GROUPBY_2" value="if (SELECT.GROUPBY == 'ASOR') {return 'GHM';} else {return SELECT.GROUPBY;}" />
				<ARG name="GROUPBY_TAB" value="'TAB'" />
				<ARG name="COLUMNBYCOUNT" value="'12'" />
				<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="Analyse"  shortLabel="Analyse"  rowContext="false" buttonType="VIEWLINK_ANALYSE_MCO">			
                <VIEWITEM label="Analyse" shortLabel="Analyse" view="PMSI000007.XML" enabled="true" rowContext="false" buttonType="ANALYSE">
                    <ARG name="PERIODE" value="return VIEW.PERIODE;" />
                    <ARG name="TOPERIODE" value="return VIEW.TOPERIODE;" />
                    <ARG name="GROUPBY_TAB" value="'AUTO'" />
                </VIEWITEM>              
                <VIEWITEM label="Analyse paramétrable" shortLabel="Analyse CA" view="PMSI000439.XML" enabled="true" rowContext="false" buttonType="ANALYSE">
                    <ARG name="PERIODE" value="return VIEW.PERIODE;" />
                    <ARG name="TOPERIODE" value="return VIEW.TOPERIODE;" />
                    <ARG name="GROUPBY_TAB" value="'AUTO'" />
                    <ARG name="LS_DATA" value="'-1'" />
                    <ARG name="DATA01" value="'1.1'" />
                    <ARG name="DATA02" value="'2.1'" />
                    <ARG name="DATA03" value="'2.4'" />
                    <ARG name="DATA04" value="'2.5'" />
                    <ARG name="DATA05" value="'2.2'" />
                    <ARG name="DATA06" value="'2.3'" />
                    <ARG name="DATA07" value="'1.11'" />
                    <ARG name="DATA08" value="'1.9'" />
                    <ARG name="DATA09" value="'3.1'" />
                    <ARG name="DATA10" value="'0'" />
                    <ARG name="DATA11" value="'0'" />
                    <ARG name="DATA12" value="'0'" />
                    <ARG name="DATA13" value="'0'" />
                    <ARG name="DATA14" value="'0'" />
                    <ARG name="DATA15" value="'0'" />
                </VIEWITEM>
			</VIEWLINK>
			<VIEWLINK label="Liste des RSS" shortLabel="Liste RSS" view="PMSI000038.XML" componentName="RSS_BASE_VIEWLINK" component2Name="DATE_COMP_2_VIEWLINK" />
		</VIEWLINKS>
         <ONGLET excelLabel="Effet Simplifié" label="Effet Simplifié" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHART title="" type="group" subType="" percentHeight="100" >
				<CHART title="Chiffre d'affaires (10 premiers)" type="pieChart" subType="" maxItems="10" maxItemsSortOn="" maxItemsSortSeq="" sortField="D2_NOW" sortSeq="D" condition="ROW.LVL == '1'">
					<CATEGORY field="TXT" type="Char" />
					<SERIE field="D2_NOW" displayName="SELECT.DATA02_LABEL" displayNameCalc="true" />
				</CHART>
                <CHART title="Séjours pour les 10 premiers" type="columnChart" maxItems="10" maxItemsSortOn="D1_NOW" maxItemsSortSeq="D" sortField="COD" sortSeq="A" condition="ROW.LVL == '1'">
                    <CATEGORY field="CODTXT" type="Char" />
                    <SERIE field="EPXS" displayName="Effet Prix " displayNameCalc="false" />
                    <SERIE field="EVLS" displayName="Effet Volume" displayNameCalc="false" />
                </CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="70" variableRowHeight="true" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_3 == '-1' || SELECT.GROUPBY_TAB == 'TAB'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<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 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="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q1)'+ '\n' + SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\n' + 'Séjours'" headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_NOW" type="Number" width="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q2)' + '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\n' + 'Séjours'" headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_ECA" type="Number" width="80" outputFormat="= SELECT.DATA012" headerText="@LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.D1_NOW &lt; ROW.D1_OLD) || (SELECT.DATA014 == 'N' &amp;&amp; ROW.D1_NOW &gt; ROW.D1_OLD)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.D1_NOW &gt; ROW.D1_OLD) || (SELECT.DATA014 == '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"/>
						<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="@LF@ % évol." textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				
				<COLUMN dataField="D2_OLD" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\n' + SELECT.DATA02_LABEL" headerTextCalc="true" description="= SELECT.DATA023 " textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_NOW" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\n' + SELECT.DATA02_LABEL" headerTextCalc="true" description="= SELECT.DATA023" textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_ECA" type="Number" width="95" outputFormat="#E" headerText="(X1) @LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.D2_NOW &lt; ROW.D2_OLD) || (SELECT.DATA024 == 'N' &amp;&amp; ROW.D2_NOW &gt; ROW.D2_OLD)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.D2_NOW &gt; ROW.D2_OLD) || (SELECT.DATA024 == '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"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
                </COLUMN>
				<COLUMN dataField="D2_PCT" type="Number" width="45" outputFormat="= if (ROW.D2_OLD !=0) {return '0%'} else {return '#'}" headerText="@LF@ % évol." textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="CA_MOY_OLD" type="Number" width="80" outputFormat="#E" headerText="'(P1)' + '\n' + 'CA moyen '+ SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL " headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D2_OLD / ROW.D1_OLD)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="CA_MOY_NOW" type="Number" width="80" outputFormat="#E" headerText="'(P2)' + '\n' + 'CA moyen ' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL" headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D2_NOW / ROW.D1_NOW)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="EPXS" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Prix" description="EP=(P2-P1)*Q2" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.CA_MOY_NOW - ROW.CA_MOY_OLD)* ROW.D1_NOW" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EPXS &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="EVLS" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Volume" description="EV=(Q2-Q1)*P1" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D1_NOW - ROW.D1_OLD)* ROW.CA_MOY_OLD" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EVLS &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="ETOT" type="Number" width="90" outputFormat="#E" headerText="@LF@ Somme des Effets" description="X1 = EP + EV " totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.EPXS + ROW.EVLS)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
		<ONGLET excelLabel="Effet croisé" label="Effet croisé" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">

			<CHART title="" type="group" subType="" percentHeight="100" >
				<CHART title="Chiffre d'affaires (10 premiers)" type="pieChart" subType="" maxItems="10" maxItemsSortOn="" maxItemsSortSeq="" sortField="D2_NOW" sortSeq="D" condition="ROW.LVL == '1'">
					<CATEGORY field="TXT" type="Char" />
					<SERIE field="D2_NOW" displayName="SELECT.DATA02_LABEL" displayNameCalc="true" />
				</CHART>
                <CHART title="Séjours pour les 10 premiers" type="columnChart" maxItems="10" maxItemsSortOn="D1_NOW" maxItemsSortSeq="D" sortField="COD" sortSeq="A" condition="ROW.LVL == '1'">
                    <CATEGORY field="CODTXT" type="Char" />
                    <SERIE field="EPX" displayName="Effet Prix " displayNameCalc="false" />
                    <SERIE field="EVL" displayName="Effet Volume" displayNameCalc="false" />
                    <SERIE field="ECR" displayName="Effet Croisé" displayNameCalc="false" />
                </CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="120" variableRowHeight="true" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_3 == '-1' || SELECT.GROUPBY_TAB == 'TAB'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<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 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="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q1)'+ '\n' + SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\n' + 'Séjours'" headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_NOW" type="Number" width="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q2)' + '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\n' + 'Séjours'" headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_ECA" type="Number" width="80" outputFormat="= SELECT.DATA012" headerText="@LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.D1_NOW &lt; ROW.D1_OLD) || (SELECT.DATA014 == 'N' &amp;&amp; ROW.D1_NOW &gt; ROW.D1_OLD)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.D1_NOW &gt; ROW.D1_OLD) || (SELECT.DATA014 == '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"/>
						<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="@LF@ % évol." textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				
				<COLUMN dataField="D2_OLD" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL + '\n' + SELECT.DATA02_LABEL" headerTextCalc="true" description="= SELECT.DATA023 " textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_NOW" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL + '\n' + SELECT.DATA02_LABEL" headerTextCalc="true" description="= SELECT.DATA023" textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_ECA" type="Number" width="95" outputFormat="#E" headerText="(X1) @LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.D2_NOW &lt; ROW.D2_OLD) || (SELECT.DATA024 == 'N' &amp;&amp; ROW.D2_NOW &gt; ROW.D2_OLD)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.D2_NOW &gt; ROW.D2_OLD) || (SELECT.DATA024 == '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"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
                </COLUMN>
				<COLUMN dataField="D2_PCT" type="Number" width="45" outputFormat="= if (ROW.D2_OLD !=0) {return '0%'} else {return '#'}" headerText="@LF@ % évol." textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="CA_MOY_OLD" type="Number" width="80" outputFormat="#E" headerText="'(P1)' + '\n' + 'CA moyen '+ SELECT.PERIODE_D_LABEL + '\n' + SELECT.TOPERIODE_D_LABEL " headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D2_OLD / ROW.D1_OLD)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="CA_MOY_NOW" type="Number" width="80" outputFormat="#E" headerText="'(P2)' + '\n' + 'CA moyen ' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL" headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D2_NOW / ROW.D1_NOW)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="EPX" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Prix" description="EP=(P2-P1)*Q1" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.CA_MOY_NOW - ROW.CA_MOY_OLD)* ROW.D1_OLD" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EPX &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="EVL" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Volume" description="EV=(Q2-Q1)*P1" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D1_NOW - ROW.D1_OLD)* ROW.CA_MOY_OLD" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EVL &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="ECR" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Croisé" description="EC=(Q2-Q1)*(P2-P1)" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="((ROW.D1_NOW - ROW.D1_OLD)*(ROW.CA_MOY_NOW - ROW.CA_MOY_OLD) )" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.ECR &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="ETOT" type="Number" width="90" outputFormat="#E" headerText="@LF@ Somme des Effets" description="X1 = EP + EV + EC" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.EPX + ROW.EVL + ROW.ECR)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
       
	</PRESENTATION>
</VUE>
