Showing posts with label customers. Show all posts
Showing posts with label customers. Show all posts

Friday, March 30, 2012

How to simplify my endless query. Thanks.

Hello group!

I am having a problem with simplying my query...

I would like to get customers' balance info based on how many months
since they opened their accounts. The tricky part here is accounts
starting with '28' are treated differently than other accounts, they
are given 3 months grace period. In other words, for all other
accounts, their month0 balance is the balance of their open_month, and
month1 balance is the balance after the account is opened 1 month, and
so on. But accounts starting with '28' month0 balance would be the
balance after the account is opened 3 months, and month1 balance would
be the balance after the account is opened 4 months, and so on.

My query below works, but since some customers are more than 10 years
old (more than 120 months), my query is endless! Does anyone know a
better way to do the same job? Many thanks!

create table a
(person_id int
,account int
,open_date datetime)

insert into a values(1,200001,'11/15/2004')
insert into a values(2,280001,'8/20/2004')

create table b
(account int
,balance_date datetime
,balance money)

insert into b values(200001,'11/30/2004',700)
insert into b values(200001,'12/31/2004',800)
insert into b values(200001,'1/31/2005',900)
insert into b values(200001,'2/28/2005',1000)
insert into b values(280001,'8/30/2004',7000)
insert into b values(280001,'9/30/2004',8000)
insert into b values(280001,'10/31/2004',9000)
insert into b values(280001,'11/30/2004',10000)
insert into b values(280001,'12/31/2004',15000)
insert into b values(280001,'1/31/2005',20000)
insert into b values(280001,'2/28/2005',30000)

--Ideal output--

person_idacc_nomonth0_balancemonth1_balancemonth2_balancemonth3_balance
120000017008009001000
2280000110000150002000030000

select a.person_id
,a.account
,month0_balance=case
when a.account like '2%' and a.account not like '28%'
then
sum(case datediff(mm, a.open_date, balance_date) when 0
then b.balance else 0 end)
else sum(case datediff(mm, a.open_date, balance_date)
when 3 then b.balance else 0 end)
end
,month1_balance =case
when a.account like '2%' and a.account not like '28%'
then
sum(case datediff(mm, a.open_date, balance_date) when 1
then b.balance else 0 end)
else sum(case datediff(mm, a.open_date, balance_date)
when 4 then b.balance else 0 end)
end
from a as a
join b as b
on a.account=b.account
group by a.person_id, a.account(rong.guo@.gmail.com) writes:
> My query below works, but since some customers are more than 10 years
> old (more than 120 months), my query is endless! Does anyone know a
> better way to do the same job? Many thanks!

Hm, first I read endless as "query runs forever", but now I realize
that you want one column for each month.

That's a dynamic cross-tab, which you cannot to in SQL out-of-box,
since a query always produces a table with a well-defined set of
columns.

You could use dynamic SQL to create the beast; you can read about
dynamic SQL on my web site: http://www.sommarskog.se/dynamic_sql.html.
You may also consider the third-party tool RAC, which is very good
for this sort of things. (They say. I have never used it myself, but
it's a standard recommendation.) It's at http://www.rac4sql.net/.

Since I first misread your question, I looked at improving the query.
Since this is a simple join, good indexing is probably the best for
performance. But this maybe somewhat more effective:

select a.person_id, a.account,
month0_balance = SUM(CASE datediff(mm, a.open_date, balance_date)
WHEN CASE WHEN a.account LIKE '2%' AND
a.account NOT LIKE '28%'
THEN 0
ELSE 3
END THEN b.balance
ELSE 0
END),
month1_balance = SUM(CASE datediff(mm, a.open_date, balance_date)
WHEN CASE WHEN a.account LIKE '2%' AND
a.account NOT LIKE '28%'
THEN 1
ELSE 4
END THEN b.balance
ELSE 0
END)
from a as a
join b as b on a.account=b.account
group by a.person_id, a.account

(Egads! I have never had a CASE in the WHEN part of a CASE expression
before!)

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks, Erland!
Sorry for the misleading word 'endless'... And you are right, I've
never had a CASE in the WHEN part of a CASE expression:-)) but it is so
exciting to learn! Thanks again!|||On Fri, 18 Mar 2005 23:20:17 +0000 (UTC), Erland Sommarskog wrote:

> (rong.guo@.gmail.com) writes:
>> My query below works, but since some customers are more than 10 years
>> old (more than 120 months), my query is endless! Does anyone know a
>> better way to do the same job? Many thanks!
> Hm, first I read endless as "query runs forever", but now I realize
> that you want one column for each month.
> That's a dynamic cross-tab, which you cannot to in SQL out-of-box,
> since a query always produces a table with a well-defined set of
> columns.

I would start with this (perhaps as a view) to collect the monthly balances
and do the 3 month correction for 28s:

select a.person_id, a.account,
sum(b.balance) AS MonthBalance,
'Month' + convert(varchar(),
datediff(mm, a.open_date, balance_date) -
case when a.account LIKE '2%' AND a.account NOT like '28%' then 0
else 3 END)
AS MonthNum
FROM a as a
JOIN b as b on a.account=b.account
GROUP BY a.person_id, a.account,
datediff(mm, a.open_date, balance_date) -
case when a.account LIKE '2%' AND a.account NOT like '28%' then 0
else 3 END

Then I'd put a crosstab tool on the client to consume this.

Sunday, February 19, 2012

how to set a dimension attribute as a simple "note" field?

I have a simple cube,
dimensions are time and customers (id, name, address, contry, etc), fact are
quantity
On Y axes I have to show the customer name AND the address.
if I drag and drop only the id and name, the query is fast, and it works
fine, If after the name I also add the address, the query becames very slow
I belive this is because of aggregation on the address attribute, that I
really don't need, the address is specific to every customer and it does not
make any sense to do calculation on this.
I only need to show che address near the name, without any aggregation
How can I do it?
Is there any property I have to set?
Thank you
Alessandro Belli
Hello Alessandro,
I understand that you'd like to specify an dimension attribute as a
property not to be aggregated. If I'm off-base, please let me know.
You may want to consider define attribute relationship bewteen attribute
name and address, thus you could display address as member property of name
and do not necessary to drag name attribute to the browser which cause more
calculations and overhead even if they are 1:1 relationship. When you drag
a dimension attribute into the browser it is used as normal attribute
anyway though at running time, it will gain performance improvement when
engine may find it has 1:1 relationship with another attribute.
By default, dimension attribute are related to key dimension attribute by a
attribute relationship. In VS 2005, you could open the dimension in VS
project, and check the attribute relationships defined on the key attribute
( I assume it is "id" in the dimension).
You may want to create a attribute relationship directly on name attribute
and define the relationship bweteen name and address. You will be able to
see address as the member property of the name attribute in browser. You
could right click the a name cell->Show properties in report->Show All
properties in report.
The other option that you could display name/address at the same time ( I
assume it is 1:1 relationship) is that you create a new column on dimension
source table, and merge (name, address) column to a new column such as
name-address. You could use this new column as a attribute directly in the
dimension attribute.
If you have further questions or concerns on the issue, please feel free to
let's know. Than you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications
<http://msdn.microsoft.com/subscripti...s/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscripti...t/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Peter Yang [MSFT] wrote:

> Hello Alessandro,
> I understand that you'd like to specify an dimension attribute as a
> property not to be aggregated. If I'm off-base, please let me know.
> You may want to consider define attribute relationship bewteen attribute
> name and address, thus you could display address as member property of name
> and do not necessary to drag name attribute to the browser which cause more
> calculations and overhead even if they are 1:1 relationship. When you drag
> a dimension attribute into the browser it is used as normal attribute
> anyway though at running time, it will gain performance improvement when
> engine may find it has 1:1 relationship with another attribute.
> By default, dimension attribute are related to key dimension attribute by a
> attribute relationship. In VS 2005, you could open the dimension in VS
> project, and check the attribute relationships defined on the key attribute
> ( I assume it is "id" in the dimension).
> You may want to create a attribute relationship directly on name attribute
> and define the relationship bweteen name and address. You will be able to
> see address as the member property of the name attribute in browser. You
> could right click the a name cell->Show properties in report->Show All
> properties in report.
> The other option that you could display name/address at the same time ( I
> assume it is 1:1 relationship) is that you create a new column on dimension
> source table, and merge (name, address) column to a new column such as
> name-address. You could use this new column as a attribute directly in the
> dimension attribute.
> If you have further questions or concerns on the issue, please feel free to
> let's know. Than you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications
> <http://msdn.microsoft.com/subscripti...s/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscripti...t/default.aspx>.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
You can add address as property for name attribute and can create
calculated measure on this property.
Regards
Amish Shah
http://shahamishm.tripod.com
|||Peter Yang [MSFT] wrote:

> Hello Alessandro,
> I understand that you'd like to specify an dimension attribute as a
> property not to be aggregated. If I'm off-base, please let me know.
> You may want to consider define attribute relationship bewteen attribute
> name and address, thus you could display address as member property of name
> and do not necessary to drag name attribute to the browser which cause more
> calculations and overhead even if they are 1:1 relationship. When you drag
> a dimension attribute into the browser it is used as normal attribute
> anyway though at running time, it will gain performance improvement when
> engine may find it has 1:1 relationship with another attribute.
> By default, dimension attribute are related to key dimension attribute by a
> attribute relationship. In VS 2005, you could open the dimension in VS
> project, and check the attribute relationships defined on the key attribute
> ( I assume it is "id" in the dimension).
> You may want to create a attribute relationship directly on name attribute
> and define the relationship bweteen name and address. You will be able to
> see address as the member property of the name attribute in browser. You
> could right click the a name cell->Show properties in report->Show All
> properties in report.
> The other option that you could display name/address at the same time ( I
> assume it is 1:1 relationship) is that you create a new column on dimension
> source table, and merge (name, address) column to a new column such as
> name-address. You could use this new column as a attribute directly in the
> dimension attribute.
> If you have further questions or concerns on the issue, please feel free to
> let's know. Than you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications
> <http://msdn.microsoft.com/subscripti...s/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscripti...t/default.aspx>.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
You can add address as property for name attribute and can create
calculated measure on this property.
Regards
Amish Shah
http://shahamishm.tripod.com
|||Thank you for you suggestion, but is not clear to me how to make a
relationship between name and address.
Is enought to set address.keycolumn= customers.name and
addess.namecolumn=address?
Or what I have to do to make the realtionship?
The key of the dimension is a field named "code". Do I also have to set
name.keycolumn=customers.code?
After this when I browse the cube and I right click the name cell->Show
properties in report->Show All
> properties in report the option is grayed.
Thank's
Alessandro
"Peter Yang [MSFT]" <petery@.online.microsoft.com> ha scritto nel messaggio
news:gdsQ4cR4GHA.2336@.TK2MSFTNGXA01.phx.gbl...
> Hello Alessandro,
> I understand that you'd like to specify an dimension attribute as a
> property not to be aggregated. If I'm off-base, please let me know.
> You may want to consider define attribute relationship bewteen attribute
> name and address, thus you could display address as member property of
> name
> and do not necessary to drag name attribute to the browser which cause
> more
> calculations and overhead even if they are 1:1 relationship. When you drag
> a dimension attribute into the browser it is used as normal attribute
> anyway though at running time, it will gain performance improvement when
> engine may find it has 1:1 relationship with another attribute.
> By default, dimension attribute are related to key dimension attribute by
> a
> attribute relationship. In VS 2005, you could open the dimension in VS
> project, and check the attribute relationships defined on the key
> attribute
> ( I assume it is "id" in the dimension).
> You may want to create a attribute relationship directly on name attribute
> and define the relationship bweteen name and address. You will be able to
> see address as the member property of the name attribute in browser. You
> could right click the a name cell->Show properties in report->Show All
> properties in report.
> The other option that you could display name/address at the same time ( I
> assume it is 1:1 relationship) is that you create a new column on
> dimension
> source table, and merge (name, address) column to a new column such as
> name-address. You could use this new column as a attribute directly in the
> dimension attribute.
> If you have further questions or concerns on the issue, please feel free
> to
> let's know. Than you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications
> <http://msdn.microsoft.com/subscripti...s/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscripti...t/default.aspx>.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
|||Hello Alessandro,
You could try the following steps to add attribute relationship between
name and address attribute.
1. Open customer dimension by double click the dimension on the right panel
2. Drag Address column from the source table in Data Source View to the
Name Attribute on the left panel, and you shall see a new Attribute
relationship under attribute Name.
3. Process the dimension and cube and you shall see member property Address
under Name Attribute
Please see if this could meet your requirement. If you have any concerns or
questions, please let me know. Thank you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

how to set a dimension attribute as a simple "note" field?

I have a simple cube,
dimensions are time and customers (id, name, address, contry, etc), fact are
quantity
On Y axes I have to show the customer name AND the address.
if I drag and drop only the id and name, the query is fast, and it works
fine, If after the name I also add the address, the query becames very slow
I belive this is because of aggregation on the address attribute, that I
really don't need, the address is specific to every customer and it does not
make any sense to do calculation on this.
I only need to show che address near the name, without any aggregation
How can I do it?
Is there any property I have to set?
Thank you
Alessandro BelliHello Alessandro,
I understand that you'd like to specify an dimension attribute as a
property not to be aggregated. If I'm off-base, please let me know.
You may want to consider define attribute relationship bewteen attribute
name and address, thus you could display address as member property of name
and do not necessary to drag name attribute to the browser which cause more
calculations and overhead even if they are 1:1 relationship. When you drag
a dimension attribute into the browser it is used as normal attribute
anyway though at running time, it will gain performance improvement when
engine may find it has 1:1 relationship with another attribute.
By default, dimension attribute are related to key dimension attribute by a
attribute relationship. In VS 2005, you could open the dimension in VS
project, and check the attribute relationships defined on the key attribute
( I assume it is "id" in the dimension).
You may want to create a attribute relationship directly on name attribute
and define the relationship bweteen name and address. You will be able to
see address as the member property of the name attribute in browser. You
could right click the a name cell->Show properties in report->Show All
properties in report.
The other option that you could display name/address at the same time ( I
assume it is 1:1 relationship) is that you create a new column on dimension
source table, and merge (name, address) column to a new column such as
name-address. You could use this new column as a attribute directly in the
dimension attribute.
If you have further questions or concerns on the issue, please feel free to
let's know. Than you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
<http://msdn.microsoft.com/subscript...ps/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscript...rt/default.aspx>.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||Peter Yang [MSFT] wrote:
[vbcol=seagreen]
> Hello Alessandro,
> I understand that you'd like to specify an dimension attribute as a
> property not to be aggregated. If I'm off-base, please let me know.
> You may want to consider define attribute relationship bewteen attribute
> name and address, thus you could display address as member property of nam
e
> and do not necessary to drag name attribute to the browser which cause mor
e
> calculations and overhead even if they are 1:1 relationship. When you drag
> a dimension attribute into the browser it is used as normal attribute
> anyway though at running time, it will gain performance improvement when
> engine may find it has 1:1 relationship with another attribute.
> By default, dimension attribute are related to key dimension attribute by
a
> attribute relationship. In VS 2005, you could open the dimension in VS
> project, and check the attribute relationships defined on the key attribut
e
> ( I assume it is "id" in the dimension).
> You may want to create a attribute relationship directly on name attribute
> and define the relationship bweteen name and address. You will be able to
> see address as the member property of the name attribute in browser. You
> could right click the a name cell->Show properties in report->Show All
> properties in report.
> The other option that you could display name/address at the same time ( I
> assume it is 1:1 relationship) is that you create a new column on dimensio
n
> source table, and merge (name, address) column to a new column such as
> name-address. You could use this new column as a attribute directly in the
> dimension attribute.
> If you have further questions or concerns on the issue, please feel free t
o
> let's know. Than you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> l]
> ications
> <[url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx" target="_blank">http://msdn.microsoft.com/subscript...ps/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscript...rt/default.aspx>.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights.[/vbcol
]
You can add address as property for name attribute and can create
calculated measure on this property.
Regards
Amish Shah
http://shahamishm.tripod.com|||Peter Yang [MSFT] wrote:
[vbcol=seagreen]
> Hello Alessandro,
> I understand that you'd like to specify an dimension attribute as a
> property not to be aggregated. If I'm off-base, please let me know.
> You may want to consider define attribute relationship bewteen attribute
> name and address, thus you could display address as member property of nam
e
> and do not necessary to drag name attribute to the browser which cause mor
e
> calculations and overhead even if they are 1:1 relationship. When you drag
> a dimension attribute into the browser it is used as normal attribute
> anyway though at running time, it will gain performance improvement when
> engine may find it has 1:1 relationship with another attribute.
> By default, dimension attribute are related to key dimension attribute by
a
> attribute relationship. In VS 2005, you could open the dimension in VS
> project, and check the attribute relationships defined on the key attribut
e
> ( I assume it is "id" in the dimension).
> You may want to create a attribute relationship directly on name attribute
> and define the relationship bweteen name and address. You will be able to
> see address as the member property of the name attribute in browser. You
> could right click the a name cell->Show properties in report->Show All
> properties in report.
> The other option that you could display name/address at the same time ( I
> assume it is 1:1 relationship) is that you create a new column on dimensio
n
> source table, and merge (name, address) column to a new column such as
> name-address. You could use this new column as a attribute directly in the
> dimension attribute.
> If you have further questions or concerns on the issue, please feel free t
o
> let's know. Than you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> l]
> ications
> <[url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx" target="_blank">http://msdn.microsoft.com/subscript...ps/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscript...rt/default.aspx>.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights.[/vbcol
]
You can add address as property for name attribute and can create
calculated measure on this property.
Regards
Amish Shah
http://shahamishm.tripod.com|||Thank you for you suggestion, but is not clear to me how to make a
relationship between name and address.
Is enought to set address.keycolumn= customers.name and
addess.namecolumn=address?
Or what I have to do to make the realtionship?
The key of the dimension is a field named "code". Do I also have to set
name.keycolumn=customers.code?
After this when I browse the cube and I right click the name cell->Show
properties in report->Show All
> properties in report the option is grayed.
Thank's
Alessandro
"Peter Yang [MSFT]" <petery@.online.microsoft.com> ha scritto nel messagg
io
news:gdsQ4cR4GHA.2336@.TK2MSFTNGXA01.phx.gbl...
> Hello Alessandro,
> I understand that you'd like to specify an dimension attribute as a
> property not to be aggregated. If I'm off-base, please let me know.
> You may want to consider define attribute relationship bewteen attribute
> name and address, thus you could display address as member property of
> name
> and do not necessary to drag name attribute to the browser which cause
> more
> calculations and overhead even if they are 1:1 relationship. When you drag
> a dimension attribute into the browser it is used as normal attribute
> anyway though at running time, it will gain performance improvement when
> engine may find it has 1:1 relationship with another attribute.
> By default, dimension attribute are related to key dimension attribute by
> a
> attribute relationship. In VS 2005, you could open the dimension in VS
> project, and check the attribute relationships defined on the key
> attribute
> ( I assume it is "id" in the dimension).
> You may want to create a attribute relationship directly on name attribute
> and define the relationship bweteen name and address. You will be able to
> see address as the member property of the name attribute in browser. You
> could right click the a name cell->Show properties in report->Show All
> properties in report.
> The other option that you could display name/address at the same time ( I
> assume it is 1:1 relationship) is that you create a new column on
> dimension
> source table, and merge (name, address) column to a new column such as
> name-address. You could use this new column as a attribute directly in the
> dimension attribute.
> If you have further questions or concerns on the issue, please feel free
> to
> let's know. Than you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> l]
> ications
> <[url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx" target="_blank">http://msdn.microsoft.com/subscript...ps/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscript...rt/default.aspx>.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Hello Alessandro,
You could try the following steps to add attribute relationship between
name and address attribute.
1. Open customer dimension by double click the dimension on the right panel
2. Drag Address column from the source table in Data Source View to the
Name Attribute on the left panel, and you shall see a new Attribute
relationship under attribute Name.
3. Process the dimension and cube and you shall see member property Address
under Name Attribute
Please see if this could meet your requirement. If you have any concerns or
questions, please let me know. Thank you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============

How to service data for multiple customers

Hello All,

I do not know if this is the proper group to ask my question. Please do
direct me to the proper place.

I have a database server and would like to store data for multiple
groups of customers. The data is not shared amongst the groups but are
shared only amongst individuals composing a group.

One solution would be to lump all data from all groups into a single
instance of the database server accompanied with a tag that would
identify to which group each piece of information belongs.

Is there a better method to achieve what I want to do. Would my
solution present any difficulties in the future in terms of performance,
maintenance, scalability.

Are there other solutions that may be available to address my needs.

Any suggestions would be greatly appreciated.

ThanksCREATE TABLE CustomerGrps
(grp_nbr INTEGER NOT NULL, -- a code for the CHAID analysis??
customer_id ...,
..
PRIMARY KEY (grp_nbr, customer_id),
...)'|||Thanks for the input. I was looking towards a solution more from a DBA's
perspective rather than a programmer's perspective.

For example. In order to service multiple groups of customers. Would it be
better to have one sqlserver instance to service the need of all groups of
customers or would it be more advantageous to install multiple instances of
sqlserver, one instance for each group of customers.

thanks

"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1121912144.832540.98870@.g49g2000cwa.googlegro ups.com...
> CREATE TABLE CustomerGrps
> (grp_nbr INTEGER NOT NULL, -- a code for the CHAID analysis??
> customer_id ...,
> ..
> PRIMARY KEY (grp_nbr, customer_id),
> ..)'|||If all the customers will have similar admin/support demands and expect
the same service levels then fewer servers/instances will likely mean
less work from a DBA perspective. In that case, the main considerations
will probably be around performance/scalability and any security
concerns the customer has about sharing the server with others.
Multiple instances on the same server don't offer anything much on the
scalability front but design the application such that it can support
multiple servers in case you need that capability in the future.

--
David Portas
SQL Server MVP
--