简体   繁体   中英

how to setup a hierarchy dimension within SSAS

I'm new to BIDS and trying to figure out how to properly setup and bind a dimension hierarchy. Within my project I have a look-up table created for time this table only goes from 00:00:00 to 23:59:59. The first two rows within the look-up table account for either Null values which could exist or if a time measure exceeds 24 hrs. Note: this is not a time table for selecting times but used in counting the span of time.

查找表

In looking at the rows you can see a running minute and running second column. The runningsecond changes for each second but the running minute will stay at zero until a minute is reached.

I'm trying to create a heiarchy that allows the user to view the count of records by running second, running minute or by time ("TheTime column)

Where I am having issues is the output seems to group and count for the seconds and time but renders a column for each minute.

产量

What I was hoping to accomplish was to have an out put where there is only one 0 column listed and then drilling down I would see multiple entries for running seconds, and then multiple entries for TheTime.

I have the dimension setup as follows:

尺寸

With the dimensional relationship setup as

DIM2

and the granularity on the dimensional usage set to the running minute

粒度

For each one of the dimensions in the hierarchy I have the key mapped to the SpanID (as it is the only unique value in the lookup). with the values set to the respective field.

I've tried swapping around the bindings as well as the relationship within the dimension but have had no luck in getting the output to render in the desired manner. Running queries in sql I can see the numbers match up as far as counts but I seem to be missing how to group all the running minutes together. Within the properties of each attribute of the dimension I do have Encourage grouping enabled.

I'd appreciate any suggestions or direction on what I'm missing or doing incorrectly

-cheers

updates:

@Michael - Yes For each field TheTime, RunningMinute and RunningSeconds I have the key set to SpanId. This was the only way I could get the dimension to process if I set the Key to the root field name (RunningMinute Key=RunningMinute, I would get the following OLAP error:

Errors in the OLAP storage engine: A duplicate attribute key has been found when processing:
Table: 'dbo_dimTimeSpan', 
Column: 'RunningSecond', 
Value: '0'. The attribute is 'Running Second'.

Thanks to Michael for pointing me in the right direction. I won't take credit for this but I will provide additional information as to what I did to correct. This. Michael was correct in the statement that using another attribute as the key would cause the duplication of columns as I was seeing. To correct this I went to each attribute and set the KeyColumns value in the properties to:

RunningMinute = RunningMinute
RunningSecond = RunningSecond
TheTime = SpanId (this was the main key)

This then caused a second issue. Since my look-up table had null values in the runningsecond and runningminute columns I was receiving a processing error. To correct this I had to expand the properties section for the KeyColumns and change the NullProcessing property to Unknown. This then allowed for me to process and deploy the cube

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM