Showing posts with label provide. Show all posts
Showing posts with label provide. Show all posts

Sunday, March 25, 2012

Analysis server for Business people

How can we impliment the sqlserver analysis to the customer site for analysing the transaction. Please provide me the solution for this. Is it possible for the business people use this analysis server for their transaction. What we have to do to impliment this in customer site .

Please kindly advice

Try to talk to microsoft consulting serivces in your area for help with implementing solution to analyze your transactional data. I am sure they would help you to come up with some ideas and will help you implementing them.

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

Saturday, February 25, 2012

AMO: Use a query for datasourceview schema

Hi!

I want to use a query that returns all the necessary information to make a cube

Is there a way to provide this query to the datasourceview.schema property without adding any other tables?

So you basically have one big view that contains all your measures and all the attributes for every dimension?

I think this should be possible, the data source view is basically a .Net DataSet object, so you could just create a single table in your dataset with this view as the source.

But this is not really a recommended architecture. I would expect processing performance to suffer, SSAS would end up doing a lot of select distincts over the attribute columns. You would normally want to have all the tables and joins referenced in this view in your DSV.

|||

I know that there will be performance issues but all I have in my hands is a query and not even a view (actually many queries each for one cube)

In Analysis Services Designer you can provide just a named query but I do not know how to do this programmatically.

I suspect that after filling the datasourceview schema with an adapter, some extended properties will have to be added so as data to be fetched from the tables of the database to cube. Something like this:

Datasourceview.schema.Tables(0).ExtendedProperties.Add("TableType", "NamedQuery")

Datasourceview.schema.Tables(0).ExtendedProperties.Add("QueryDefinition", Query)

but it does not work!!! (cube is created but has no data)

Any idea?

|||I believe you want:

Datasourceview.schema.Tables(0).ExtendedProperties.Add("TableType", "View")

I don't know if that'll solve your problem, but that's the proper syntax for that statement AFAIK.

C
|||I think Chris is correct, the table type looks like it might have to be set to "View". The AMOAdventureWorks sample shows how to build a cut down version of the Adventure Works database using purely AMO (Although it does not contain an example of creating a named query) I'm not sure, but it's possible that you may also need to set:

Datasourceview.schema.tables(0).ExtendedProperties.Add("IsLogical", "True")

|||And, if i remember correctly, i had to remove the Schema name from the DT as well..

Datasourceview.schema.tables(0).ExtendedProperties.Remove("DBSchemaName")

C


AMO: Use a query for datasourceview schema

Hi!

I want to use a query that returns all the necessary information to make a cube

Is there a way to provide this query to the datasourceview.schema property without adding any other tables?

So you basically have one big view that contains all your measures and all the attributes for every dimension?

I think this should be possible, the data source view is basically a .Net DataSet object, so you could just create a single table in your dataset with this view as the source.

But this is not really a recommended architecture. I would expect processing performance to suffer, SSAS would end up doing a lot of select distincts over the attribute columns. You would normally want to have all the tables and joins referenced in this view in your DSV.

|||

I know that there will be performance issues but all I have in my hands is a query and not even a view (actually many queries each for one cube)

In Analysis Services Designer you can provide just a named query but I do not know how to do this programmatically.

I suspect that after filling the datasourceview schema with an adapter, some extended properties will have to be added so as data to be fetched from the tables of the database to cube. Something like this:

Datasourceview.schema.Tables(0).ExtendedProperties.Add("TableType", "NamedQuery")

Datasourceview.schema.Tables(0).ExtendedProperties.Add("QueryDefinition", Query)

but it does not work!!! (cube is created but has no data)

Any idea?

|||I believe you want:

Datasourceview.schema.Tables(0).ExtendedProperties.Add("TableType", "View")

I don't know if that'll solve your problem, but that's the proper syntax for that statement AFAIK.

C
|||I think Chris is correct, the table type looks like it might have to be set to "View". The AMOAdventureWorks sample shows how to build a cut down version of the Adventure Works database using purely AMO (Although it does not contain an example of creating a named query) I'm not sure, but it's possible that you may also need to set:

Datasourceview.schema.tables(0).ExtendedProperties.Add("IsLogical", "True")

|||And, if i remember correctly, i had to remove the Schema name from the DT as well..

Datasourceview.schema.tables(0).ExtendedProperties.Remove("DBSchemaName")

C


Thursday, February 9, 2012

Alternative to Full Text Search ?

I'm aiming to provide a Ranked multiple keyword search for a varchar(3175) column on my database but Full Text Search is not an option and there could be as many as 15,000 rows in a result list.

I see that I have two choices.

1. Do everything on the Database server.
Get all results that match all submitted keywords and then count how many times each keyword is found for each record. Total each score for each record.

2. Do all of this nasty processor intenstive work on the web server
Get all results that match all submitted keywords from the database and place in a DataTable. For each record in the DataTable perform some C# based match and count loop. Place result of each loop in extra 'Result' column of DataTable and the sort DataTable according to score.

I can confidently code up option 2 however option 1 seems like a real headache in terms of the necessary SQL (my SQL is not that good). Also I think with option two I can use Caching to save the reordered datatable primary key with cache parameters based on the submitted keywords so the search should eventually get quite fast.

Does this all sound like nonsense ?
Has anyone tried to provide a Ranked multiple keyword search without using a Full Text Indexing ?

Thanks.Full Text Indexing would obviously be the right tool for this job.

What comes to mind for the next best solution would be to write a UDF which will take a keyword and a string and return the number of occurrences of the keyword in the string. Then you could sort by the number of occurrences.

The resulting query would look like this:


SELECT
Description,
OccurrenceCount
FROM
(SELECT Description, dbo.fnOccurrenceCount(@.SearchFor, Description) AS OccurrenceCount FROM myTable ) A
WHERE
OccurrenceCount > 0
ORDER BY
OccurrenceCount DESC,
Description

And the UDF would look like this:


CREATE FUNCTION dbo.fnOccurrenceCount (@.SearchNeedle varchar(8000), @.SearchHaystack varchar(8000))
RETURNS integer AS
BEGIN

DECLARE @.OccurrenceCount int
DECLARE @.FoundPosition int
DECLARE @.SearchHaystackPart varchar(1000)
DECLARE @.SearchNeedleLength int

SET @.OccurrenceCount = 0
SET @.FoundPosition = 0
SET @.SearchHaystackPart = @.SearchHaystack
SET @.SearchNeedleLength = DATALENGTH(@.SearchNeedle)

SET @.FoundPosition = CHARINDEX(@.SearchNeedle, @.SearchHayStackPart)
WHILE @.FoundPosition > 0
BEGIN
SET @.OccurrenceCount = @.OccurrenceCount + 1
SET @.SearchHaystackPart = SUBSTRING(@.SearchHaystackPart,@.FoundPosition+@.SearchNeedleLength,8000)
SET @.FoundPosition = CHARINDEX(@.SearchNeedle, @.SearchHayStackPart)
END

RETURN @.OccurrenceCount

END

Terri|||[sorry if this appears as a double post my last reply must have timed out]

Thanks Terri - that works really well ! - without trying to sound too dramtic - your're a life saver !

As I said in my first post my C# is OK but my T-SQL is not great. Can you recommend any books or article links I can read which could help me to work out solutions like this for myself ?

Thanks again,

TheDr|||Cool, I'm glad you were able to make use of that method!

Personally I have found that participating in forums such as this and those on aspadvice.com to be the best way to increase my knowledge. Reading other people's problems and then trying out different ways to solve them has helped me immensely -- especially when others recommend methods I hadn't even thought of. Following links that the experts post on the forums also helps.

For reading material, I would have to recommend Ken Henderson's The Guru's Guide to Transact-SQL as a must-read.

Terri|||The only question I have is from the following line of your Proc what does the 'A' represent ? If I try any run the Proc without it I'm given an error. Is it an alias for the parenthesised result ?

<snip>
(SELECT Description, dbo.fnOccurrenceCount(@.SearchFor, Description) AS OccurrenceCount FROM myTable ) A
</snip
Thanks for your book suggestion. I'll look out for that one.
Cheers.|||Yes, that's exactly what it is; an alias for the derived table. A lazy alias at that. When using derived tables a "correlation name alias" (as they call it) is required.

Terri

alternative for crystal NEXT function

Hi,
Is there any alternative in SSRS 2000 for the NEXT function of Crystal. Or
can someone provide a code snippet or logic for the same.
--
Afaq ChoonawalaI am sorry, my Crystal knowledge is a little vague at this moment :-) Can
you tell us what this function does?
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Afaq" <Afaq@.discussions.microsoft.com> wrote in message
news:00748057-0DC5-4EE3-8C6D-A31EEEF1CA98@.microsoft.com...
> Hi,
> Is there any alternative in SSRS 2000 for the NEXT function of Crystal. Or
> can someone provide a code snippet or logic for the same.
> --
> Afaq Choonawala|||u can check the value any column in the next record while still being on the
current record
"Teo Lachev [MVP]" wrote:
> I am sorry, my Crystal knowledge is a little vague at this moment :-) Can
> you tell us what this function does?
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "Afaq" <Afaq@.discussions.microsoft.com> wrote in message
> news:00748057-0DC5-4EE3-8C6D-A31EEEF1CA98@.microsoft.com...
> > Hi,
> >
> > Is there any alternative in SSRS 2000 for the NEXT function of Crystal. Or
> > can someone provide a code snippet or logic for the same.
> > --
> > Afaq Choonawala
>
>|||There is no alternative for forward or random navigation. There is a
Previous function but it is an opposite of what you are trying to
accomplish. I hope a future release of RS would give us access to the
dataset before it is "bound" to the region, e.g. similar to binding ASP.NET
user controls. For the time being, consider bringing the the next record
value in the current record by transforming data at the data source.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Afaq" <Afaq@.discussions.microsoft.com> wrote in message
news:408D700E-F282-467E-8B89-85D779958F4D@.microsoft.com...
>u can check the value any column in the next record while still being on
>the
> current record
>
> "Teo Lachev [MVP]" wrote:
>> I am sorry, my Crystal knowledge is a little vague at this moment :-) Can
>> you tell us what this function does?
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "Afaq" <Afaq@.discussions.microsoft.com> wrote in message
>> news:00748057-0DC5-4EE3-8C6D-A31EEEF1CA98@.microsoft.com...
>> > Hi,
>> >
>> > Is there any alternative in SSRS 2000 for the NEXT function of Crystal.
>> > Or
>> > can someone provide a code snippet or logic for the same.
>> > --
>> > Afaq Choonawala
>>|||Not sure if you will find this useful for your situation or not, but I am in
the process of converting our reports from Crystal Reports to SQL Server
Reporting Services and I came up with the following alternative for the NEXT
function in our situation.
Many of our reports consist of multiple groups with subtotals and grand
totals in the group footers. On some of the CR reports, we have a
conditional page break which forces a page break only if the NEXT group value
is equal to the current value. For example: {@.Bank_Name/Bank_HEADER} = Next
({@.Bank_Name/Bank_HEADER})
This prevents a group footer from appearing on a single page by itself.
My SSRS solution is to place all the group footer information in the
innermost group footer, but within their own individual table rows with the
innermost group footer's Page break at End property checked. Then I define
the table row's hidden property to an expression which evaluates the row
number of the group with the row count of the group, such as
=(RowNumber("table1_Group2")<>CountRows("table1_Group2")).
My Group 1 and Report Footers row hidden properties have the following
respective expressions:
=(RowNumber("table1_Group1")<>CountRows("table1_Group1"))
=(RowNumber("table1")<>CountRows("table1"))
As for the aggregate functions in each of the table rows, I apply the same
scope values to achieve the Group 2, Group 1, and report totals as in:
=Count(Fields!Formula_Acct_Num.Value, "table1_Group2")
=Count(Fields!Formula_Acct_Num.Value, "table1_Group1")
=Count(Fields!Formula_Acct_Num.Value, "table1")
= Sum(Fields!Formula_Balance.Value, "table1_Group2")
= Sum(Fields!Formula_Balance.Value, "table1_Group1")
= Sum(Fields!Formula_Balance.Value, "table1")
Enjoy!
"Teo Lachev [MVP]" wrote:
> There is no alternative for forward or random navigation. There is a
> Previous function but it is an opposite of what you are trying to
> accomplish. I hope a future release of RS would give us access to the
> dataset before it is "bound" to the region, e.g. similar to binding ASP.NET
> user controls. For the time being, consider bringing the the next record
> value in the current record by transforming data at the data source.
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "Afaq" <Afaq@.discussions.microsoft.com> wrote in message
> news:408D700E-F282-467E-8B89-85D779958F4D@.microsoft.com...
> >u can check the value any column in the next record while still being on
> >the
> > current record
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> >> I am sorry, my Crystal knowledge is a little vague at this moment :-) Can
> >> you tell us what this function does?
> >>
> >> --
> >> HTH,
> >> ---
> >> Teo Lachev, MVP, MCSD, MCT
> >> "Microsoft Reporting Services in Action"
> >> "Applied Microsoft Analysis Services 2005"
> >> Home page and blog: http://www.prologika.com/
> >> ---
> >> "Afaq" <Afaq@.discussions.microsoft.com> wrote in message
> >> news:00748057-0DC5-4EE3-8C6D-A31EEEF1CA98@.microsoft.com...
> >> > Hi,
> >> >
> >> > Is there any alternative in SSRS 2000 for the NEXT function of Crystal.
> >> > Or
> >> > can someone provide a code snippet or logic for the same.
> >> > --
> >> > Afaq Choonawala
> >>
> >>
> >>
>
>