shuai's profile娱乐精神PhotosBlog Tools Help

Blog


    4/17/2006

    Study MDX by example, lesson 1

     
    1.先来个最简单的:
    SELECT
    { [Measures].[Dollar Sales], [Measures].[Unit Sales] }
    on columns,
    { [Time].[Q1, 2005], [Time].[Q2, 2005] }
    on rows
    FROM [Sales]
    WHERE ([Customer].[MA])
    输出是:
      Dollar Sales Unit Sales
    Q1, 2005 96,949.10 3,866
    Q2, 2005 104,510.20 4,125
    on columns和on rows是控制维度输出的轴(axis)([Measures]测量度其实是一种特殊的维度)
    FROM子句后面跟的[Sales]是cube了
    WHERE子句当然是将条件限定为[Customer].[MA]
    很简单
     

    2.再来一个
    SELECT
    { [Time].[Q1, 2005], [Time].[Q2, 2005], [Time].[Q3, 2005] }
    on columns,
    { [Customer].[MA], [Customer].[CT] }
    on rows
    FROM Sales
    WHERE ( [Measures].[Dollar Sales] )
    输出是:
     Q1, 2005 Q2, 2005 Q3, 2005
    MA 96,949.10 104,510.20 91,025.00
    CT 12,688.40 24,660.70 16,643.90
    注意,这次WHERE子句用的是测量度[Measures].[Dollar Sales]
    这理解起来其实有点变态:每个单元格值是两个维度相交的[Measures].[Dollar Sales]值
     

    3.轴
    上边是on columns和on rows,其实可以用axis(n)的写法,比如:
    { [Time].[Q1, 2005], [Time].[Q2, 2005], [Time].[Q3, 2005] }
    on axis(0),
    {[Customer].[MA], [Customer].[CT] }
    on axis(1)
    这些数字的含义是:
    0 Columns
    1 Rows
    2 Pages
    3 Chapters
    4 Sections
    如果轴数超过4的时候,就必须用axis,因为没有别名哟
    注意你使用axis时必须相邻,就是不可以从0跳到2,下面是一个错误的例子:
    SELECT
    {[Customer].[MA], [Customer].[CT] }
    on axis(2),
    { [Time].[Q1, 2005], [Time].[Q2, 2005], [Time].[Q3, 2005] }
    on axis(0)
    FROM Sales
    WHERE ( [Measures].[Dollar Sales] )
    当然混合写是没问题的:
    SELECT
    {[Customer].[MA], [Customer].[CT] }
    on rows,
    { [Time].[Q1, 2005], [Time].[Q2, 2005], [Time].[Q3, 2005] }
    on axis(0)
    FROM Sales
    WHERE ( [Measures].[Dollar Sales] )
     

    4.大小写和版式
    MDX不区别大写的:
    SELECT
    { [Time].[Q1, 2005], [Time].[Q2, 2005], [Time].[Q3, 2005] }
    ON COLUMNS, ...
    ON COLUMNS写成大写没问题
    另外写成这样更易读啦:
    SELECT {
      [Time].[Q1, 2005]
    , [Time].[Q2, 2005]
    , [Time].[Q3, 2005]
    }
    ON
    COLUMNS,
    4/11/2006

    Data Mining Algorithms of SSAS

    1.Predicting a discrete attribute. For example, to predict whether the recipient of a targeted mailing campaign will buy a product.
     to use:Microsoft Decision Trees Algorithm、Microsoft Naive Bayes Algorithm、Microsoft Clustering Algorithm、Microsoft Neural Network Algorithm (SSAS)
     
    2.Predicting a continuous attribute. For example, to forecast next year's sales.
     to use:Microsoft Decision Trees Algorithm、Microsoft Time Series Algorithm
     
    3.Predicting a sequence. For example, to perform a clickstream analysis of a company's Web site.
     to use:Microsoft Sequence Clustering Algorithm
     
    4.Finding groups of common items in transactions. For example, to use market basket analysis to suggest additional products to a customer for purchase.
     to use:Microsoft Association Algorithm、Microsoft Decision Trees Algorithm、
     
    5.Finding groups of similar items. For example, to segment demographic data into groups to better understand the relationships between attributes.
     to use:Microsoft Clustering Algorithm、Microsoft Sequence Clustering Algorithm
    4/3/2006

    F1前三轮


    目前积分
    雷诺  42 
    迈凯轮  23 
    法拉利  15 
    本田  13 
    宝马-索伯 10 
    丰田  7 
    威廉姆斯 5 
    红牛车队 1 
    红牛二队 1 
    超级亚久里 0 
    米德兰  0
     
    我的年度预测:
    迈凯轮
    雷诺
    法拉利
    本田
    丰田
    威廉姆斯
    宝马-索伯
    红牛
    米德兰
    红牛二队
    超级亚久里

    看起来差不多

    排位赛更改规则后,确实更好看了
    雷诺比想象中的更稳定
    红牛二队比想象中的更强(周米纳迪时代相比)
    米德兰比竟然和迈凯轮的车的样子差不多
    让我很难区别,不过实力就差太多了

    昨天的比赛巴顿和蒙托亚都很可惜
    尤其是巴顿