首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关于五旬节商业分析未显示十进制数的报告

关于五旬节商业分析未显示十进制数的报告
EN

Stack Overflow用户
提问于 2019-07-10 12:01:06
回答 1查看 107关注 0票数 0

我有一个蒙德里安魔方与“个人”。我需要为每个个体添加两个类别,并为这些类别提供一个概率数值。该数据属于一个新的维度“类别”。数据来自Postgres 9物化视图,其概率在Postgres中为“数值”类型。

但是,当我试图将数据显示为“数值”时,带有十进制值的行根本不会显示。

如果我将概率取为百分比并舍入它们的值,那么所有的行都会正确地显示。

代码语言:javascript
复制
<Dimension name="Categories">
    <Hierarchy name="Category1" visible="true" hasAll="true" primaryKey="id" caption="Categories">
      <Table name="individuals_mv" schema="public"/>
      <Level  approxRowCount="6000" name="Category1" visible="true" column="category_1" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never"/>
    </Hierarchy>
    <Hierarchy name="CategoryProbability1" visible="true" hasAll="true" primaryKey="id" caption="Categories">
      <Table name="individuals_mv" schema="public"/>
      <Level  approxRowCount="6000" name="CategoryProb1" visible="true" column="category_prob_1" type="Numeric" uniqueMembers="false" levelType="Regular" hideMemberIf="Never"/>
    </Hierarchy>
    <Hierarchy name="Category2" visible="true" hasAll="true" primaryKey="id" caption="Categories">
      <Table name="individuals_mv" schema="public"/>
      <Level  approxRowCount="6000" name="Category2" visible="true" column="category_2" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never"/>
    </Hierarchy>
    <Hierarchy name="CategoryProbability2" visible="true" hasAll="true" primaryKey="id" caption="Categories">
      <Table name="individuals_mv" schema="public"/>
      <Level  approxRowCount="6000" name="CategoryProb2" visible="true" column="category_prob_2" type="Numeric" uniqueMembers="false" levelType="Regular" hideMemberIf="Never"/>
    </Hierarchy>
 </Dimension>

Individuals_mv的内容:

代码语言:javascript
复制
individual  category_1  category_prob_1 category_2  category_prob_2
61411120    [NULL]      [NULL]          [NULL]      [NULL]
10658560    [NULL]      [NULL]          [NULL]      [NULL]
60652135    [NULL]      [NULL]          [NULL]      [NULL]
10657820    "C1"        0.32846         "C3"        0.1957235187
60873351    "C1"        0.33012354      "C2"        0.2763309777
61399718    [NULL]      [NULL]          [NULL]      [NULL]
61378272    [NULL]      [NULL]          [NULL]      [NULL]
61378554    [NULL]      [NULL]          [NULL]      [NULL]

报告产出:

代码语言:javascript
复制
Individual       Category1            CategoryProb1        Category2            CategoryProb2
"10658560"      "Not Available"      "Not Available"      "Not Available"      "Not Available"
"60652135"      "Not Available"      "Not Available"      "Not Available"      "Not Available"
"61378272"      "Not Available"      "Not Available"      "Not Available"      "Not Available"
"61378554"      "Not Available"      "Not Available"      "Not Available"      "Not Available"
"61399718"      "Not Available"      "Not Available"      "Not Available"      "Not Available"
"61411120"      "Not Available"      "Not Available"      "Not Available"      "Not Available"
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-07-15 09:24:29

简单地说:在Mondrian中,不能使用小数作为水平键。

层次结构级别必须是离散的,而数值不是离散的。所以蒙德里安总是把十进制部分截掉。

相反,应该将数字值作为字符串级别的属性。

例如,

代码语言:javascript
复制
<Dimension name="Categories">
    <Hierarchy name="Category1" visible="true" hasAll="true" primaryKey="id" caption="Categories">
      <Table name="individuals_mv" schema="public"/>
      <Level  approxRowCount="6000" name="Category1" visible="true" column="category_1" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
            <Property name="CategoryProb1" column="category_prob_1" type="Numeric" />
      </Level>
    </Hierarchy>
(...)
 </Dimension>

然后,这些属性可用于定义MDX查询计算的度量值。但它们不能直接用作水平。

或者,您可以将值截断为固定数量的小数,并使用LevelType作为字符串,但这会有些尴尬。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56970283

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档