Search code examples
sql-serverssasolapcubedimension

Created date dimension unable to slicing through cube


My RDBMS is SQL Sserver, and I'm working on SSAS.

Fact: I have a fact called fact

date                 | payment
2014-01-04 00:00:00  |198000.00
2015-01-02 00:00:00  |381400.00
2017-01-01 00:00:00  |70500.00
2019-01-03 00:00:00  |891000.00
2015-02-02 00:00:00  |22000.00
...

and then I created time dimension on SSAS by creating time dim

- Generating table in data source
- I choose 5 time periods = year, halfyear, quarter, month, date
- I choose regular calendar

It creates this much column

       [PK_Date]
      ,[Date_Name]
      ,[Year]
      ,[Year_Name]
      ,[Half_Year]
      ,[Half_Year_Name]
      ,[Quarter]
      ,[Quarter_Name]
      ,[Month]
      ,[Month_Name]
      ,[Day_Of_Year]
      ,[Day_Of_Year_Name]
      ,[Day_Of_Half_Year]
      ,[Day_Of_Half_Year_Name]
      ,[Day_Of_Quarter]
      ,[Day_Of_Quarter_Name]
      ,[Day_Of_Month]
      ,[Day_Of_Month_Name]
      ,[Month_Of_Year]
      ,[Month_Of_Year_Name]
      ,[Month_Of_Half_Year]
      ,[Month_Of_Half_Year_Name]
      ,[Month_Of_Quarter]
      ,[Month_Of_Quarter_Name]
      ,[Quarter_Of_Year]
      ,[Quarter_Of_Year_Name]
      ,[Quarter_Of_Half_Year]
      ,[Quarter_Of_Half_Year_Name]
      ,[Half_Year_Of_Year]
      ,[Half_Year_Of_Year_Name]
      ,[Fiscal_Year]
      ,[Fiscal_Year_Name]
      ,[Fiscal_Half_Year]
      ,[Fiscal_Half_Year_Name]
      ,[Fiscal_Quarter]
      ,[Fiscal_Quarter_Name]
      ,[Fiscal_Month]
      ,[Fiscal_Month_Name]
      ,[Fiscal_Day]
      ,[Fiscal_Day_Name]
      ,[Fiscal_Day_Of_Year]
      ,[Fiscal_Day_Of_Year_Name]
      ,[Fiscal_Day_Of_Half_Year]
      ,[Fiscal_Day_Of_Half_Year_Name]
      ,[Fiscal_Day_Of_Quarter]
      ,[Fiscal_Day_Of_Quarter_Name]
      ,[Fiscal_Day_Of_Month]
      ,[Fiscal_Day_Of_Month_Name]
      ,[Fiscal_Month_Of_Year]
      ,[Fiscal_Month_Of_Year_Name]
      ,[Fiscal_Month_Of_Half_Year]
      ,[Fiscal_Month_Of_Half_Year_Name]
      ,[Fiscal_Month_Of_Quarter]
      ,[Fiscal_Month_Of_Quarter_Name]
      ,[Fiscal_Quarter_Of_Year]
      ,[Fiscal_Quarter_Of_Year_Name]
      ,[Fiscal_Quarter_Of_Half_Year]
      ,[Fiscal_Quarter_Of_Half_Year_Name]
      ,[Fiscal_Half_Year_Of_Year]
      ,[Fiscal_Half_Year_Of_Year_Name]

After the dimension created I link it to the fact.

They are successfully built. After I browse the cube this comes out.

month                |payment
2014-01-04 00:00:00  |40982534943.62
2015-01-02 00:00:00  |40982534943.62
2017-01-01 00:00:00  |40982534943.62
2019-01-03 00:00:00  |40982534943.62
2015-02-02 00:00:00  |40982534943.62
....

Which possibly not the result I need

Why is this happening? I have change the datatype of time dimension to be the same as the date type in fact.


Solution

  • i solve it by change the pk column name from time dimension same as fact date column. After i reload the project and remake it the relationship automatically made. when the fk column name was different as the fact column i make it manually.

    solution : make the column name the same. whether you change the dimension column into fact or change fact column into dimension.