if you have a column that is a datetime type, it needs to be converted to a numeric value before it can be used in a meassure in SSAS. To do so we can do the following to the column:
StartTime and EndTime are both DateTime:
,CONVERT(FLOAT,ljl.StartTime) + 2 AS StartSecond
,CONVERT(FLOAT,ljl.EndTime) + 2 AS EndSecond
This is done on the table/view that SSAS is looking at.
In Visual Studio, when you drag the StartSecond from the table into the Measures (at the left side of the screen) in the Cube Structure.
For start use minimum, and for end time date use maximum for the Usage.
In excel when you view the cube, you can format the field with custom format: dd/mm/yyyy hh:mm:ss to get datetime value
or
you can do it in the cube, by clicking on the measure, and change its properties:
formatString: yyyy-mm-dd hh:mm:ss
StartTime and EndTime are both DateTime:
,CONVERT(FLOAT,ljl.StartTime) + 2 AS StartSecond
,CONVERT(FLOAT,ljl.EndTime) + 2 AS EndSecond
This is done on the table/view that SSAS is looking at.
In Visual Studio, when you drag the StartSecond from the table into the Measures (at the left side of the screen) in the Cube Structure.
For start use minimum, and for end time date use maximum for the Usage.
In excel when you view the cube, you can format the field with custom format: dd/mm/yyyy hh:mm:ss to get datetime value
or
you can do it in the cube, by clicking on the measure, and change its properties:
formatString: yyyy-mm-dd hh:mm:ss
Ingen kommentarer:
Send en kommentar