Skip to main content
typo
Source Link
Tom V
  • 15.7k
  • 7
  • 64
  • 87

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute member for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

Also, KeyColumns can be comprised of multiple columns acting as a unique key instead of a single key like in my example.

Sometimes when it's too risky for existing reports to change the structure already in place it might be a good option to add an extra attribute.

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute member for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

Also, KeyColumns can be comprised of multiple columns acting as a unique key instead of a single key like in my example.

Sometimes when it's too risky for existing reports to change the structure already in place it might be a good option to add extra attribute.

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute member for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

Also, KeyColumns can be comprised of multiple columns acting as a unique key instead of a single key like in my example.

Sometimes when it's too risky for existing reports to change the structure already in place it might be a good option to add an extra attribute.

incorporated reply to comment
Source Link
Tom V
  • 15.7k
  • 7
  • 64
  • 87

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute member for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

Also, KeyColumns can be comprised of multiple columns acting as a unique key instead of a single key like in my example.

Sometimes when it's too risky for existing reports to change the structure already in place it might be a good option to add extra attribute.

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute member for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute member for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

Also, KeyColumns can be comprised of multiple columns acting as a unique key instead of a single key like in my example.

Sometimes when it's too risky for existing reports to change the structure already in place it might be a good option to add extra attribute.

added 11 characters in body
Source Link
Tom V
  • 15.7k
  • 7
  • 64
  • 87

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute valuemember for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute value for each distinct value in the key column, even if the value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

That behaviour is dependent on your KeyColumns setting.

Given a cube with these 2 named queries in the datasource view

Cities:

SELECT        1 AS id, 'India' AS country, 'Calcutta' AS city
UNION
SELECT        2 AS id, 'India' AS country, 'Bangalore' AS city

Sales:

SELECT        1 AS city, 5 AS salesamount
UNION
SELECT        2 AS city, 5 AS salesamount

A dimension based on cities, linked to the Sales table on the sales.city->cities.id relation that looks like this, using the id column as KeyColumns:

enter image description here

The result is this:

enter image description here

However, if I change the KeyColumn property to country for that attribute like this:

enter image description here

The result is all sales are reported under one single country:

enter image description here

I agree the documentation is a bit terse:

Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound. The value of this column for each member is displayed to users unless a value is specified for the NameColumn property.

Where you should interpret it as "there is one separate attribute member for each distinct value in the key column, even if the displayed value is the same"

Do note however that changing the key column might require you to change the NameColumn and the OrderBy properties.

added 6 characters in body
Source Link
Tom V
  • 15.7k
  • 7
  • 64
  • 87
Loading
Source Link
Tom V
  • 15.7k
  • 7
  • 64
  • 87
Loading