Showing posts with label category. Show all posts
Showing posts with label category. Show all posts

Sunday, March 11, 2012

AS2005. Distinct count meausure + aggregate seems to be a bug.

Look at following Query

-- the first query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count],[Measures].[Internet Sales Amount]})

ON ROWS

FROM [Adventure Works]

--and the second query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count]})

ON ROWS

FROM [Adventure Works]

The first query gets wrong result for the distinct count measure, the second one gets the right result.

I have tested it against build 2184 and buld 2195. Both have the same result.

Is the bug already fixed in SP2?

Yes, the problem was fixed in SP2. A public CTP release is scheduled to come out in a few weeks.|||

It would be more exectly if you wrtie "is scheduled to come out in a few weeks - 1", because you wrote more then a week ago the same words "a public beta release is scheduled to come out in a few weeks."

|||Nothing has changed to the release schedule since last time but unexpected things could happen before the software is actually released. Just don't want to promise you a specific date since it is out of my control, or any individual's control for that matter.

AS2005. Distinct count meausure + aggregate seems to be a bug.

Look at following Query

-- the first query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count],[Measures].[Internet Sales Amount]})

ON ROWS

FROM [Adventure Works]

--and the second query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count]})

ON ROWS

FROM [Adventure Works]

The first query gets wrong result for the distinct count measure, the second one gets the right result.

I have tested it against build 2184 and buld 2195. Both have the same result.

Is the bug already fixed in SP2?

Yes, the problem was fixed in SP2. A public CTP release is scheduled to come out in a few weeks.|||

It would be more exectly if you wrtie "is scheduled to come out in a few weeks - 1", because you wrote more then a week ago the same words "a public beta release is scheduled to come out in a few weeks."

|||Nothing has changed to the release schedule since last time but unexpected things could happen before the software is actually released. Just don't want to promise you a specific date since it is out of my control, or any individual's control for that matter.

Wednesday, March 7, 2012

AS stops working, Eventid 22, category 256

Hi!

During the last week my AS2005 server has behaved strangely. It works for two-three days and then it stops and cant handle any more queries. However i can list the catalog and cubes in ProClarity but when i try to connect to a cube it does not work. The same when i go to Management Studio. If i restart the service it works again, probably for another 2-3 days.

Also AS2005 send a lot of error events to the eventlog. All like this(i think one for every query that fails but i am not sure). Event id looks like this:

Event Type: Error
Event Source: MSSQLServerOLAPService
Event Category: (256)
Event ID: 22
Date: 2006-08-23
Time: 13:09:47
User: N/A
Computer: XXXXX
Description:
The description for Event ID ( 22 ) in Source ( MSSQLServerOLAPService ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Internal error: An unexpected exception occured.

It is a x64 box with 4GB ram and Windows Server 2003 R2. I have SP1 installed and its only AS 2005 running on it.

Any clue to what the reason could be? Could it be something that is fixed in the cumalitve hotfix package?

Description for the error code 22 is "An unexpected exception occured." doesnt give you much.

There is not much I can suggest you here. Try contacting Microsoft customer support services and report your problem.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Saturday, February 25, 2012

Articles in more than one Category - How to organize tables?

Greetings,
I have one table, named Article, and one table name Category.
The problem is, one Article could be in just one or in several categories.
What is the best way to connect data between Article and Category according to fast search performance?
I have several ideas:
1. To have third cross table Article_Category with fields Article_ID and Category_ID, and search Article_Category table
2. To have several INTEGER columns in Article table (like Category_ID1, Category_ID2,..) and search those columns
3. Add one VARCHAR field in Article table where I could write Category ID's delimited by some character (e.g. by comma), and do text search in only that column.
What is recommended for solving problems like this?

Option 1 makes the most sense. This is how many-to-many relationships are generally implemented.

|||Thanks for advice Adam|||Yes, that is how I implemented them, it works well. Then you can use an inner join to join the article info to the category info.|||

Will you have:
Option A: Many-to-Many (category 1 has article 1 and 2, category 2 has article 3, etc)

Option B: 1-to-Many (Category 1 has article 2, category 2 has article 2, category 3 has article 5, etc)
If B, you can put your article_id in your category table. This would give you the fastest search performance and allow your joins to be simpler.

Nick

|||Hi bmains,
how large are your tables?
Do you run it on Web with ASP.NET?
Do you satisfied with search speed?|||Hi Nick,
one Category will have many articles,
one Article could be in more than one category.

There is 500 000 articles and almost 2000 categories.
Regards|||

If you are talking a join between the join table and the two main tables, then no, I wouldn't worry about speed; it shouldn't be worse performance-wise. Though, if you are talking a lot of joins, then you need to worry more. outer joins are worse than inner joins; inner joins aren't bad; here we have a requirement that you have to try to rewrite a query to use an inner join if possible, when an outer join is used.

Article: Database Mirroring Not Ready for Production When SQL Server 2005 Ships

Can someone at Microsoft comment on this article, specifically, how it relates to SQL Replication? Will SQL Replication fall into the category of what this article describes, or only the mirroring feature?

Thanks,
PeterYes, Database Mirroring won't be available when SQL Server 2005 ships. Please refer to this: http://www.microsoft.com/sql/2005/productinfo/letter.mspx. However this does not affect replication at all.

Sunday, February 19, 2012

Array (or similar thing ) in sql server

I would like to write a fun or stored procedure to
do some operation.
It require me to know that what category is currently belong to certain people
(people_table: category_table
1 to Many)
However, when i use the select statement in stored proc, it return a set of result, not a scalar , therefore, i cannot use the variable to hold it. In addition, there are no array in SQL server.
Question:
1. Is there any way to hold the collection of result(like array)?
2. Also, how to determine to use fun or stored procedure?
(Since a integer is need to return by them)
Thx

When you perform a select statement you're going to get back records in a tabular format. The easiest way to do what you want is to use the select statement and in your code load that into a datatable and if you'd like put that into an array. I guess you could use an ExecuteReader function and then load it into your array... but that sound like a lot of code. If you just need to return one value then use the ExecuteScaler and assign that to your variable. Hope this helps.|||Thx!
However, I want to do this job inside the db, but not using executereader
First, the performance is better as it is operated in db, not need to take data outside
Second, the arhcit design require me to encapsulate the some logic in DB, I am sure there are some way to deal with this problem.
I have think to create a temp table or similar method. However, I am new to db programe. Can anyone give me some idea?
|||Try this link do Arrays in SQL Server. Hope this helps.
http://www.sommarskog.se/arrays-in-sql.html|||Great. Thx