~openerp-community/openobject-doc/6.1

« back to all changes in this revision

Viewing changes to source/bi/MDXOverview/examples.rst

  • Committer: TruongSinh Tran
  • Date: 2009-07-19 19:02:35 UTC
  • Revision ID: truongsinh@vipescoserver-20090719190235-fu3bxcrbpvwuk5h7
[FIX] build_i18n.py .. raw:: html

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
A look at few examples to write MDX Queries
 
2
-------------------------------------------
 
3
 
 
4
Writing a simple MDX on a SALES Schema::
 
5
 
 
6
    select 
 
7
      {[partner_country].[all]} on rows,
 
8
      {[measures].[Items Sold]} on columns
 
9
    from sale_order_line
 
10
 
 
11
Gives results as,
 
12
 
 
13
===================== ============
 
14
 /                     Items Sold
 
15
===================== ============
 
16
 All partner_country     [43.0]
 
17
===================== ============
 
18
 
 
19
 
 
20
Expanding the partner country to its children, we change the MDX as.::
 
21
 
 
22
    select 
 
23
       {[partner_country].[all],[partner_country].children} on rows, 
 
24
       {[measures].[Items Sold]} on columns 
 
25
    from sale_order_line
 
26
 
 
27
Gives result as,
 
28
 
 
29
===================== ============
 
30
 /                     Items Sold
 
31
===================== ============
 
32
 All partner_country   [43.0]
 
33
 Belgium               [30.0]
 
34
 China                 [4.0]
 
35
 France                [9.0]
 
36
===================== ============
 
37
 
 
38
One more example bit complex with slicer::
 
39
 
 
40
    select 
 
41
      {[date_order].children,[date_order].[2008].children,[date_order].[2008].[Q2].children},
 
42
      {[measures].[Items Sold]} 
 
43
    from sale_order_line 
 
44
    where ([date_order].[2008])
 
45
 
 
46
Gives results as:
 
47
 
 
48
===================== ============
 
49
 /                     Items Sold
 
50
===================== ============
 
51
 2008.0                  [43.0]
 
52
 Q1                      [43.0]
 
53
===================== ============
 
54
 
 
55