Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts

Wednesday, March 21, 2012

DMX vs Visual Studio

Hi

Are there any (important?) advantages of using data mining through DMX instead of Visual Studio 2005 on the SQL server 2005?

/Dennis

DMX is the only solution for querying the mining models, and BI Dev Studio also uses DMX in the prediction query builder.

In general, as far as mining object manipulation is concerned, DMX and the XMLA-based Analysis Services Scripting Language (aka DDL or ASSL), the script used by BI Dev Studio, have similar features.

There are a few differences, however, mostly deriving from the fact that DMX is designed as an extension for SQL, for application developers and, therefore, it is more concise (so that it can be embedded or generated by applications).

Some DDL features not supported by DMX:

full control over the metadata of mining objects. Properties such as Description, bindings, name bindings are only supported in DDL and not in DMX

Monday, March 19, 2012

DMO reports product level as sp3 instead of sp3a

Hi,
1. I am using the "ProductLevel" property of the "SQLServer2" SQL DMO object
to determine the product level of my SQL server 2000 installation. However
even when I have installed "SQL Server 2000 sp3a" on my machine, this
property still reports the server product level as sp3 (instead of sp3a). Is
there a workaround for this using which I can get the exact product level?
2. I am using the "xp_msver" sproc to get the SQL server version. The SQL
server 2000 installation with sp3 installed has version no= 8.0.760. This
version is reported by xp_msver. However when "sp3a" is installed on this,
the version is still reported as "8.0.760" when it should be "8.0.761". Is
this a bug in the execution of xp_msver?
Plz reply ASAP.
ThanxOn Mon, 14 Mar 2005 12:42:16 +0530, Onkar Walavalkar wrote:
(snip)
Hi Onkar,
As far as I know, SP3a and SP3 are the same WRT the server part; the
only differences are in the client tools. That's why the server will
never report SP3a, and that's why both SP3 and SP3a correspond to
version 8.00.760.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Sunday, March 11, 2012

Division returns 10 instead of value with decimals

I have a textbox with a value like this:
="The average score is: " & 100/9.5 & " points."
I've tried all different conversion functions I can think of but with no
result.
/PeterPeter Larsson wrote:
> I have a textbox with a value like this:
> ="The average score is: " & 100/9.5 & " points."
> I've tried all different conversion functions I can think of but with no
> result.
> /Peter
Try this:
="The average score is: " & FormatNumber(100/9.5,2) & " points."
The second argument (2) returns the number of digits past the decimal.|||Michael, thanks for replying!
Your suggestion works fine (="The average score is: " & 100/9.5 & "
points." I simplified the calculation in my original posting.
Now I have the number of decimals correct, but still only an integer
value like 1.00
The thing is that I use this in a footer row of a table, it looks
exactly like this:
="The average score is: " &
FormatNumber(SUM(Fields!Score.Value*Fields!Exp.Value)/First(Fields!Count,"NumberOfPlayers"),2)
& " points."
The values left of the \ sign is from the table dataset itself, the
NumberOfPlayers dataset is not.
I guess I have to some conversion in the expression, but I can't find
the correct function. :(
ANy ideas?
Best regards,
Peter Larsson!
Michael wrote:
> Peter Larsson wrote:
>> I have a textbox with a value like this:
>> ="The average score is: " & 100/9.5 & " points."
>> I've tried all different conversion functions I can think of but with
>> no result.
>> /Peter
> Try this:
> ="The average score is: " & FormatNumber(100/9.5,2) & " points."
> The second argument (2) returns the number of digits past the decimal.|||On Feb 11, 9:47=A0am, Peter Larsson <scape...@.hotmail.com> wrote:
> Michael, thanks for replying!
> Your suggestion works fine (=3D"The average score is: " & 100/9.5 & "
> points." I simplified the calculation in my original posting.
> Now I have the number of decimals correct, but still only an integer
> value like 1.00
> The thing is that I use this in a footer row of a table, it looks
> exactly like this:
> =3D"The average score is: " &
> FormatNumber(SUM(Fields!Score.Value*Fields!Exp.Value)/First(Fields!Count,"=N=ADumberOfPlayers"),2)
> & " points."
> The values left of the \ sign is from the table dataset itself, the
> NumberOfPlayers dataset is not.
> I guess I have to some conversion in the expression, but I can't find
> the correct function. :(
> ANy ideas?
> Best regards,
> Peter Larsson!
>
> Michael wrote:
> > Peter Larsson wrote:
> >> I have a textbox with a value like this:
> >> =3D"The average score is: " & 100/9.5 & " points."
> >> I've tried all different conversion functions I can think of but with
> >> no =A0 result.
> >> /Peter
> > Try this:
> > =3D"The average score is: " & FormatNumber(100/9.5,2) & " points."
> > The second argument (2) returns the number of digits past the decimal.- =Hide quoted text -
> - Show quoted text -
I would make sure that the Data returned is a Floating point number,
and not Integer somewhere along the line. For example, your
denominator First(Fields!Count.Value) may actually be returning an
Integer (since Counts are typically whole numbers) and thus dividing
by an Integer is an Integer, which have no decimal places, hense the
"1.000"
=3D"The average score is: " &
Format( Sum(Fields!Score.Value * Fields!Exp.Value )
/ CDbl(First(Fields!Count.Value,"N=ADumberOfPlayers")), "0.00" ) & "
points."
-- Scott|||Orne wrote:
> On Feb 11, 9:47 am, Peter Larsson <scape...@.hotmail.com> wrote:
>> Michael, thanks for replying!
>> Your suggestion works fine (="The average score is: " & 100/9.5 & "
>> points." I simplified the calculation in my original posting.
>> Now I have the number of decimals correct, but still only an integer
>> value like 1.00
>> The thing is that I use this in a footer row of a table, it looks
>> exactly like this:
>> ="The average score is: " &
>> FormatNumber(SUM(Fields!Score.Value*Fields!Exp.Value)/First(Fields!Count,"N­umberOfPlayers"),2)
>> & " points."
>> The values left of the \ sign is from the table dataset itself, the
>> NumberOfPlayers dataset is not.
>> I guess I have to some conversion in the expression, but I can't find
>> the correct function. :(
>> ANy ideas?
>> Best regards,
>> Peter Larsson!
>>
>> Michael wrote:
>> Peter Larsson wrote:
>> I have a textbox with a value like this:
>> ="The average score is: " & 100/9.5 & " points."
>> I've tried all different conversion functions I can think of but with
>> no result.
>> /Peter
>> Try this:
>> ="The average score is: " & FormatNumber(100/9.5,2) & " points."
>> The second argument (2) returns the number of digits past the decimal.- Hide quoted text -
>> - Show quoted text -
> I would make sure that the Data returned is a Floating point number,
> and not Integer somewhere along the line. For example, your
> denominator First(Fields!Count.Value) may actually be returning an
> Integer (since Counts are typically whole numbers) and thus dividing
> by an Integer is an Integer, which have no decimal places, hense the
> "1.000"
> ="The average score is: " &
> Format( Sum(Fields!Score.Value * Fields!Exp.Value )
> / CDbl(First(Fields!Count.Value,"N­umberOfPlayers")), "0.00" ) & "
> points."
> -- Scott
Hi Scott,
Well, now it suddenly works, in the following format
formatnumber((val1*val2)/val3,2) without any conversion to double, all
numbers are integer. This is really strange because I tried it many times.
I just hate when stuff just suddenly start working again, and you have
no clue what was wrong.
Thanks for helping though. :)
Regards,
Peter Larsson!

Division by zero

Hi, I have a field in which I use a division. Sometimes the denominator can
be zero. In such case, I want to return 0 instead of evaluating the division
giving me an error.
Here is what I attempted but without success. It appears that both
expressions are evaluated all the time regardless of the result of the
condition.
=iif( Fields!Denominator.Value = 0, 0, Fields!Numerator.Value/
Fields!Denominator.Value)
I would like to know if someone knows a work around to this.
Thanks,
JoeI finally found a way to do it:
=((Fields!Numerator.Value / iif( Fields!Denominator.Value = 0, 1,
Fields!Denominator.Value)) * iif( Fields!Denominator.Value = 0, 0, 1))|||Thats the way I was doing it. But if you have a bunch of these its
gets tedious and I would recommend writing a custom assembly that does
this instead.
Abe
joerage wrote:
> I finally found a way to do it:
> =((Fields!Numerator.Value / iif( Fields!Denominator.Value = 0, 1,
> Fields!Denominator.Value)) * iif( Fields!Denominator.Value = 0, 0,
1))

Friday, March 9, 2012

Division

I am trying the following SQL
declare @.var1 Float
set @.var1 = 1/2
select @.var1
I need @.var1 to be 0.5 instead of 0. Can you please let me know how I can get that?
Thanksdeclare @.var1 Float
set @.var1 = 1.0/2
select @.var1

or

declare @.var1 Float
set @.var1 = 1/2.0
select @.var1

or

declare @.var1 Float
set @.var1 = 1.0/2.0
select @.var1

int / int yields an int result!