dashboard.xml 4.91 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
<?xml version = "1.0" encoding="UTF-8"?>

<!--
<?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
-->
 <Schema name="myHR" measuresCaption="Ѵ">
<!--<Schema name="myHR" measuresCaption="%{myhr.measures.caption}"> 
-->
  <!-- Share Dimension -->
  <Dimension name="company" caption="ѷ">
    <Hierarchy name="company" hasAll="true" allMemberName="all company" allMemberCaption="ءѷ" primaryKey="COMPANYID">
      <Table name="MCOMPANY"/>
		<Level name="company" column="COMPANYID" nameColumn="TNAME" uniqueMembers="true">
		  <Property name="companyid" column="COMPANYID" caption="ʺѷ"/>
		</Level>
	</Hierarchy>
  </Dimension>

  <!-- Share Dimension-->
  <Dimension name="gender" caption="">
    <Hierarchy name="gender" hasAll="true" allMemberName="all gender" allMemberCaption="ء" primaryKey="EMPLOYEEID">
	  <Table name="MEMPLOYEE"/>
	    <Level name="gender"	column="SEX"	uniqueMembers="false">
		  <NameExpression>
            <SQL dialect="oracle">
              (case when "MEMPLOYEE"."SEX" = '1' then '' 
						  when "MEMPLOYEE"."SEX" = '2' then '˭ԧ' else ' (?)' end)
		    </SQL>
			<SQL dialect="mssql">
              (case when "MEMPLOYEE"."SEX" = '1' then '' 
						  when "MEMPLOYEE"."SEX" = '2' then '˭ԧ' else ' (?)' end)
		    </SQL>
		  </NameExpression>
		</Level>
	</Hierarchy>
  </Dimension>
  <Dimension name="bu1_e" caption="˹§ҹдѺ 1">
    <Hierarchy name="bu1" hasAll="true" allMemberName="all bu1" allMemberCaption="ء˹§ҹдѺ 1" primaryKey="EMPLOYEEID" primaryKeyTable="MEMPLOYEE">
      <Join leftKey="BU1" rightKey="BU1ID">
        <Table name="MEMPLOYEE"/>
    	<Table name="MBU1"/>
      </Join>
      <Level name="bu1id" table="MBU1" column="BU1ID" nameColumn="TDESC" uniqueMembers="true">
	    <Property name="bu1id" column="BU1ID" caption="ӹѡҹ"/>
	  </Level>
    </Hierarchy>
  </Dimension>

	  <Dimension name="bu2_e" caption="˹§ҹдѺ 2">
        <Hierarchy name="bu2" hasAll="true" allMemberName="all bu2" allMemberCaption="ء˹§ҹдѺ 2" primaryKey="EMPLOYEEID" primaryKeyTable="MEMPLOYEE">
          <Join leftKey="BU2" rightKey="BU2ID">
    	    <Table name="MEMPLOYEE"/>
    	    <Table name="MBU2"/>
          </Join>
    	  <Level name="bu2id" table="MBU2" column="BU2ID" nameColumn="TDESC" uniqueMembers="true">
		    <Property name="bu2id" column="BU2ID" caption="ٹ"/>
		  </Level>
     	</Hierarchy>
      </Dimension>

  <Dimension name="employee" caption=";ѡҹ">
    <Hierarchy name="employee" hasAll="true" allMemberName="all employee" allMemberCaption="ء;ѡҹ" primaryKey="EMPLOYEEID">
      <Table name="MEMPLOYEE"/>
		 <Level name="Name" column="EMPLOYEEID" uniqueMembers="false">
           <KeyExpression>
             <SQL dialect="oracle"> "FNAME" || ' ' || "LNAME" </SQL>
             <SQL dialect="mssql"> FNAME + ' ' + LNAME </SQL>
           </KeyExpression>
		   <OrdinalExpression>
             <SQL dialect="oracle"> "FNAME" || ' ' || "LNAME" </SQL>
             <SQL dialect="mssql"> FNAME + ' ' + LNAME </SQL>
		   </OrdinalExpression>
		  <Property name="employeeid" column="EMPLOYEEID" caption="ʾѡҹ"/>
		</Level>
	</Hierarchy>
  </Dimension>
    <Dimension name="day_type" caption=""> 
    <Hierarchy name="day_type" hasAll="true" allMemberName="all day_type" allMemberCaption="ѹ" primaryKey="EVENTGRPID">
      <Table name="MEVENTGRP"/>
		<Level name="eventgrpid" column="EVENTGRPID" nameColumn="TDESC" uniqueMembers="true">
		  <Property name="eventgrpid" column="EVENTGRPID" caption="ʻ"/>
		</Level>
	</Hierarchy>
  </Dimension> 


<Cube name="leave">
	<Table name="MEMPL_LEAVE_TOTAL"/>

      <DimensionUsage name="company"		source="company"					foreignKey="COMPANYID"/>
      <DimensionUsage name="gender"			source="gender"						foreignKey="EMPLOYEEID"/>
	  <DimensionUsage name="bu1_e"			source="bu1_e"						foreignKey="EMPLOYEEID"/>
	  <DimensionUsage name="bu2_e"			source="bu2_e"						foreignKey="EMPLOYEEID"/>
	  <DimensionUsage name="employee"		source="employee"					foreignKey="EMPLOYEEID"/>
	  <DimensionUsage name="day_type"		source="day_type"					foreignKey="DAY_TYPE"/>


	  <Measure name="day_count" column="DAY_COUNT" caption="Ѻѹ" aggregator="sum" formatString="Standard"/>

	  <CalculatedMember name="day_count_all" 
	      dimension="Measures"
		  formula="([company].[all company] , 
							[gender].[all gender] ,
							[bu1_e].[all bu1] , 
							[bu2_e].[all bu2] , 
							[employee].[all employee] , 
							[day_type].[all day_type])"
	      visible="false">
	    <CalculatedMemberProperty name="FORMAT_STRING" value="Standard"/>
      </CalculatedMember>

   <CalculatedMember 	name="day_countPercentage"
			dimension="Measures"
			formula="([Measures].day_count * 100.00 / [Measures].day_count_all)"
	        visible="true"
			caption="%">
	    <CalculatedMemberProperty name="FORMAT_STRING" value="##0.00"/>
      </CalculatedMember>

  
  </Cube> 
</Schema>