Datazen - SSAS 表格模型 - 不考虑日期

Datazen - SSAS Tabular Model - Dates not being considered

我已经使用 Datazen 一段时间了,一直在努力理解它的内部工作原理,尤其是在缺乏相关文档的情况下。

无论如何,我有一个 SSAS 表格模型,它在 table 中有一个日期时间字段标记为日期。我使用此表格模型在 excel 中创建报告并且工作正常。

现在,我想在 Datazen 中使用这个表格模型,我试图创建一个数据视图来读取 MDX 中的度量和属性

问题是当我在 Datazen 控制面板中将字段创建日期标记为 DateTime 时,它​​给我以下消息: Failed to refresh in Dashboard

这是我正在使用的 MDX 查询:

SELECT NON EMPTY { 
    [Measures].[Count of Misuse Bugs], 
    [Measures].[Count of Valid Bugs], 
[Measures].[Count of Bugs], 
[Measures].[Count of Invalid Bugs], 
[Measures].[Time Spent on invalid Bugs], 
[Measures].[Time Spent on Valid Bugs], 
[Measures].[Invalidity Ratio], 
[Measures].[Misuse Ratio] 
} ON COLUMNS, 
NON EMPTY { 
    (
    [Bugs].[BugID].[BugID].ALLMEMBERS * 
    [Bugs].[BugTitle].[BugTitle].ALLMEMBERS * 
    [Bugs].[Client].[Client].ALLMEMBERS * 
    [Bugs].[Current State].[Current State].ALLMEMBERS * 
    [Bugs].[Final Resolution].[Final Resolution].ALLMEMBERS * 
    [Bugs].[Internal Vs. External].[Internal Vs. External].ALLMEMBERS * 
    [Bugs].[Last Reasonable State].[Last Reasonable State].ALLMEMBERS * 
    [Bugs].[Owner].[Owner].ALLMEMBERS * 
    [Bugs].[Owner State].[Owner State].ALLMEMBERS * 
    [Bugs].[Project].[Project].ALLMEMBERS * 
    [Bugs].[Release].[Release].ALLMEMBERS * 
    [Bugs].[Responsibility].[Responsibility].ALLMEMBERS * 
    [Bugs].[TAR].[TAR].ALLMEMBERS * 
    [Creation Dates].[Creation Date].[Creation Date].ALLMEMBERS  
) 
} ON ROWS FROM [Bugs]

我正在使用 SQL Server 2012。如有任何帮助,我们将不胜感激。 ADDING FIELD AS DATETIME IN DATAZEN DATA VIEW

Datazen 在理解日期格式方面并不是最活跃的。尝试将它们格式化为 yyyy-MM-dd。

编辑:我正在创建一个新成员,它是格式化的日期。希望这对你有用。

WITH 
MEMBER DatazenDate AS
cdate(format([Creation Dates].[Creation Date].CURRENTMEMBER.MEMBER_VALUE, "yyyy-MM-dd"))       

SELECT NON EMPTY { 
    DatazenDate        
    [Measures].[Count of Misuse Bugs], 
        [Measures].[Count of Valid Bugs], 
    [Measures].[Count of Bugs], 
    [Measures].[Count of Invalid Bugs], 
    [Measures].[Time Spent on invalid Bugs], 
    [Measures].[Time Spent on Valid Bugs], 
    [Measures].[Invalidity Ratio], 
    [Measures].[Misuse Ratio] 
    } ON COLUMNS, 
    NON EMPTY { 
        (
        [Bugs].[BugID].[BugID].ALLMEMBERS * 
        [Bugs].[BugTitle].[BugTitle].ALLMEMBERS * 
        [Bugs].[Client].[Client].ALLMEMBERS * 
        [Bugs].[Current State].[Current State].ALLMEMBERS * 
        [Bugs].[Final Resolution].[Final Resolution].ALLMEMBERS * 
        [Bugs].[Internal Vs. External].[Internal Vs. External].ALLMEMBERS * 
        [Bugs].[Last Reasonable State].[Last Reasonable State].ALLMEMBERS * 
        [Bugs].[Owner].[Owner].ALLMEMBERS * 
        [Bugs].[Owner State].[Owner State].ALLMEMBERS * 
        [Bugs].[Project].[Project].ALLMEMBERS * 
        [Bugs].[Release].[Release].ALLMEMBERS * 
        [Bugs].[Responsibility].[Responsibility].ALLMEMBERS * 
        [Bugs].[TAR].[TAR].ALLMEMBERS * 
        [Creation Dates].[Creation Date].[Creation Date].ALLMEMBERS  
    ) 
    } ON ROWS FROM [Bugs]

我遇到了同样的问题,

我用过以下方式,

WITH 
MEMBER SalesDateAsDateTime as
Iif([Measures].[WorkOrderCount]=0, null, [Sales Date].[Calendar Date].CurrentMember.MEMBER_VALUE)

WITH 
MEMBER SalesDateAsDateTime AS
cdate(format([Sales Date].[Calendar Date].CURRENTMEMBER.MEMBER_VALUE, "yyyy-MM-dd")) 

WITH MEMBER [Measures].[SalesDateAsDateTime] AS 

([Sales Date].[Calendar Date].CurrentMember.MEMBERVALUE)

但是,所有这些都需要更长的时间才能得到结果,最后我在立方体中直接为 MAXIMUM

添加了一个日期度量

挺快的